[pure-lang-svn] SF.net SVN: pure-lang:[556] pure/trunk/lib/math.pure
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-08-21 11:49:25
|
Revision: 556 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=556&view=rev Author: agraef Date: 2008-08-21 11:49:34 +0000 (Thu, 21 Aug 2008) Log Message: ----------- Make polar and rect the identity on the respective representations. Suggested by Eddie Rucker. Modified Paths: -------------- pure/trunk/lib/math.pure Modified: pure/trunk/lib/math.pure =================================================================== --- pure/trunk/lib/math.pure 2008-08-21 11:31:10 UTC (rev 555) +++ pure/trunk/lib/math.pure 2008-08-21 11:49:34 UTC (rev 556) @@ -132,6 +132,9 @@ polar (x+:y) = sqrt (x*x+y*y) <: atan2 y x; rect (r<:t) = r*cos t +: r*sin t; +polar z@(_<:_) = z; +rect z@(_+:_) = z; + /* For convenience, make these work with real values, too. */ polar x::int | polar x::bigint = x<:0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |