[pure-lang-svn] SF.net SVN: pure-lang:[558] pure/trunk/lib/math.pure
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-08-21 13:51:28
|
Revision: 558 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=558&view=rev Author: agraef Date: 2008-08-21 13:51:39 +0000 (Thu, 21 Aug 2008) Log Message: ----------- cis should only be used with real arguments. Reported by Eddie Rucker. Modified Paths: -------------- pure/trunk/lib/math.pure Modified: pure/trunk/lib/math.pure =================================================================== --- pure/trunk/lib/math.pure 2008-08-21 13:28:11 UTC (rev 557) +++ pure/trunk/lib/math.pure 2008-08-21 13:51:39 UTC (rev 558) @@ -146,7 +146,7 @@ /* Create complex values on the unit circle. Note: To quickly compute exp (x+:y) in polar form, use exp x <: y. */ -cis t = rect (1<:t); +cis t::int | cis t::bigint | cis t::double = rect (1<:t); /* Modulus (absolute value) and argument (angle). Note that you can also find both of these in one go by converting to polar form. */ @@ -428,6 +428,8 @@ r<:t@(_%_) = r <: atan2 (sin t) (cos t) if t<-pi || t>pi; = r <: pi if t==-pi; +cis (x%y) = rect (1<:x/y); + /* Numerator and denominator. */ num (x%y) = x; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |