diff options
author | Raymond Hettinger <python@rcn.com> | 2004-07-05 20:27:53 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-07-05 20:27:53 (GMT) |
commit | 77e13b4eadd71a6f010b9488cb3e39e7cb02aefb (patch) | |
tree | 0046f529aed692641dfff4dd2b08d61ad2631231 /Doc/lib/libdecimal.tex | |
parent | c4f93d4410163629e25e76431b8b7e6d5010771f (diff) | |
download | cpython-77e13b4eadd71a6f010b9488cb3e39e7cb02aefb.zip cpython-77e13b4eadd71a6f010b9488cb3e39e7cb02aefb.tar.gz cpython-77e13b4eadd71a6f010b9488cb3e39e7cb02aefb.tar.bz2 |
Simplify examples.
Diffstat (limited to 'Doc/lib/libdecimal.tex')
-rw-r--r-- | Doc/lib/libdecimal.tex | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Doc/lib/libdecimal.tex b/Doc/lib/libdecimal.tex index a996fc9..2e68794 100644 --- a/Doc/lib/libdecimal.tex +++ b/Doc/lib/libdecimal.tex @@ -935,8 +935,8 @@ def pi(): 3.141592653589793238462643383279502887 """ getcontext().prec += 9 # extra digits for intermediate steps - one = Decimal(1) # substitute "one=1.0" for regular floats - lastc, t, c, n, na, d, da = 0*one, 3*one, 3*one, 1, 0, 0, 24*one + three = Decimal(3) # substitute "three=3.0" for regular floats + lastc, t, c, n, na, d, da = 0, three, 3, 1, 0, 0, 24 while c != lastc: lastc = c n, na = n+na, na+8 @@ -955,7 +955,6 @@ def exp(x): 7.389056098930650227230427460575007813 """ getcontext().prec += 9 # extra digits for intermediate steps - one = Decimal(1) # substitute "one=1.0" for regular floats i, laste, e, fact, num = 0, 0, 1, 1, 1 while e != laste: laste = e @@ -973,7 +972,6 @@ def cos(x): 0.8775825618903727161162815826038296521 """ getcontext().prec += 9 # extra digits for intermediate steps - one = Decimal(1) # substitute "one=1.0" for regular floats i, laste, e, fact, num, sign = 0, 0, 1, 1, 1, 1 while e != laste: laste = e @@ -992,7 +990,6 @@ def sin(x): 0.4794255386042030002732879352155713880 """ getcontext().prec += 9 # extra digits for intermediate steps - one = Decimal(1) # substitute "one=1.0" for regular floats i, laste, e, fact, num, sign = 1, 0, x, 1, x, 1 while e != laste: laste = e |