[pure-lang-svn] SF.net SVN: pure-lang:[489] pure/trunk/lib/math.pure
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-08-14 07:30:36
|
Revision: 489 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=489&view=rev Author: agraef Date: 2008-08-14 07:30:45 +0000 (Thu, 14 Aug 2008) Log Message: ----------- Add missing complex functions on rationals. Modified Paths: -------------- pure/trunk/lib/math.pure Modified: pure/trunk/lib/math.pure =================================================================== --- pure/trunk/lib/math.pure 2008-08-14 06:56:25 UTC (rev 488) +++ pure/trunk/lib/math.pure 2008-08-14 07:30:45 UTC (rev 489) @@ -453,6 +453,13 @@ abs (x%y) = abs x % y; sgn (x%y) = sgn x; +/* Complex functions. */ + +arg (x%y) = atan2 0 (x/y); +re x@(_%_) = x; +im (_%_) = 0L%1L; +conj x@(_%_) = x; + /* Rounding functions. These return exact results here. */ floor x@(_%_) = if n<=x then n else n-1 when n::bigint = trunc x end; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |