[pure-lang-svn] SF.net SVN: pure-lang:[577] pure/trunk/lib/math.pure
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-08-23 10:45:17
|
Revision: 577 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=577&view=rev Author: agraef Date: 2008-08-23 10:45:28 +0000 (Sat, 23 Aug 2008) Log Message: ----------- Fix up definition of complex powers. Modified Paths: -------------- pure/trunk/lib/math.pure Modified: pure/trunk/lib/math.pure =================================================================== --- pure/trunk/lib/math.pure 2008-08-23 10:27:31 UTC (rev 576) +++ pure/trunk/lib/math.pure 2008-08-23 10:45:28 UTC (rev 577) @@ -293,19 +293,11 @@ /* Complex powers. */ -// These are computed most easily if the 1st operand is in polar form. -// FIXME: Deal with special cases like 0^0. These always give nan now. -z1@(x1+:y1)^z2@(x2+:y2) = polar z1^z2; -z1@(x1+:y1)^z2@(r2<:t2) = polar z1^rect z2; -(r1<:t1)^z2@(x2+:y2) | -(r1<:t1)^z2@(r2<:t2) = exp (ln r1*z2)*exp((0+:t1)*z2); +z1@(_+:_)^z2 | +z1^z2@(_+:_) | +z1@(_<:_)^z2 | +z1^z2@(_<:_) = exp (ln z1*z2); -// Mixed complex/real cases. -z1@(x1+:y1)^x2 = z1 ^ (x2+:0); -x1^z2@(x2+:y2) = (x1+:0) ^ z2; -(r1<:t1)^x2 = r1^x2 <: t1*x2; -x1^z2@(r2<:t2) = (x1<:0) ^ z2; - /* Equality. */ (x1+:y1) == (x2+:y2) = x1==x2 && y1==y2; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |