diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 4 | ||||
-rw-r--r-- | src/algebra/gaussian.spad.pamphlet | 16 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2cfe5721..bc0b9d78 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2008-08-31 Waldek Hebisch <hebisch@math.uni.wroc.pl> + * algebra/gaussian.spad.pamphlet: Fix Bug AW15. + +2008-08-31 Waldek Hebisch <hebisch@math.uni.wroc.pl> + * algebra/manip.spad.pamphlet: Fix Bug AW278. 2008-08-30 Gabriel Dos Reis <gdr@cs.tamu.edu> diff --git a/src/algebra/gaussian.spad.pamphlet b/src/algebra/gaussian.spad.pamphlet index b45a902e..e09ed0c5 100644 --- a/src/algebra/gaussian.spad.pamphlet +++ b/src/algebra/gaussian.spad.pamphlet @@ -367,10 +367,18 @@ ComplexCategory(R:CommutativeRing): Category == argument x == atan2loc(imag x, real x) else - -- Not ordered so dictate two quadrants - argument x == - zero? real x => pi()$R * half - atan(imag(x) * recip(real x)::R) + if R has RadicalCategory then + argument x == + n1 := sqrt(norm(x)) + x1 := real(x) + n1 + (2::R)*atan(imag(x) * recip(x1)::R) + + else + -- Emulate sqrt using exp and log + argument x == + n1 := exp(half*log(norm(x))) + x1 := real(x) + n1 + (2::R)*atan(imag(x) * recip(x1)::R) pi() == pi()$R :: % |