[pure-lang-svn] SF.net SVN: pure-lang:[560] pure/trunk/lib/primitives.pure
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-08-21 22:46:57
|
Revision: 560 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=560&view=rev Author: agraef Date: 2008-08-21 22:47:08 +0000 (Thu, 21 Aug 2008) Log Message: ----------- Add missing nan check to ^ operator. Modified Paths: -------------- pure/trunk/lib/primitives.pure Modified: pure/trunk/lib/primitives.pure =================================================================== --- pure/trunk/lib/primitives.pure 2008-08-21 21:59:02 UTC (rev 559) +++ pure/trunk/lib/primitives.pure 2008-08-21 22:47:08 UTC (rev 560) @@ -359,7 +359,7 @@ /* The ^ operator. Works like pow, but always promotes its operands to double and returns a double result. */ -x::double^y::double = c_pow x y if x>=0 || frac y==0.0; +x::double^y::double = c_pow x y if x>=0 || frac y==0.0 || nanp x || nanp y; x::int^y::int | x::bigint^y::bigint | x::int^y::bigint | @@ -367,7 +367,7 @@ x::double^y::int | x::double^y::bigint = c_pow x (double y); x::int^y::double | -x::bigint^y::double = c_pow (double x) y if x>=0 || frac y==0.0; +x::bigint^y::double = c_pow (double x) y if x>=0 || frac y==0.0 || nanp y; = double x^y otherwise; /* Pointer arithmetic. We do this using bigints, so that the code is portable This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |