aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/float.spad.pamphlet
diff options
context:
space:
mode:
Diffstat (limited to 'src/algebra/float.spad.pamphlet')
-rw-r--r--src/algebra/float.spad.pamphlet5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/algebra/float.spad.pamphlet b/src/algebra/float.spad.pamphlet
index 26c0c253..7c5a74ae 100644
--- a/src/algebra/float.spad.pamphlet
+++ b/src/algebra/float.spad.pamphlet
@@ -423,7 +423,10 @@ Float():
p := bits(); inc 5
-- apply log(x) = n log 2 + log(x/2**n) so that 1/2 < x < 2
if negative?(n := order x) then n := n+1
- l := if n = 0 then 0 else (x := shift(x,-n); n * log2())
+ l: % :=
+ n = 0 => 0
+ x := shift(x,-n)
+ n * log2()
-- speed the series convergence by finding m and k such that
-- | exp(m/2**k) x - 1 | < 1 / 2 ** O(sqrt p)
-- write log(exp(m/2**k) x) as m/2**k + log x