]> www.ginac.de Git - ginac.git/commitdiff
* Document the rounding behavior as dicussed on ginac-list.
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Fri, 11 Jan 2002 18:48:39 +0000 (18:48 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Fri, 11 Jan 2002 18:48:39 +0000 (18:48 +0000)
doc/tutorial/ginac.texi

index 237aa3c4582cbf4e2e36d9286ed563dbf24d6e88..fb90f25af093b943088d80551bee20c29291752d 100644 (file)
@@ -984,12 +984,21 @@ The above example prints the following output to screen:
 
 @example
 in 17 digits:
-0.333333333333333333
-3.14159265358979324
+0.33333333333333333334
+3.1415926535897932385
 in 60 digits:
-0.333333333333333333333333333333333333333333333333333333333333333333
-3.14159265358979323846264338327950288419716939937510582097494459231
-@end example
+0.33333333333333333333333333333333333333333333333333333333333333333334
+3.1415926535897932384626433832795028841971693993751058209749445923078
+@end example
+
+@cindex rounding
+Note that the last number is not necessarily rounded as you would
+naively expect it to be rounded in the decimal system.  But note also,
+that in both cases you got a couple of extra digits.  This is because
+numbers are internally stored by CLN as chunks of binary digits in order
+to match your machine's word size and to not waste precision.  Thus, on
+architectures with differnt word size, the above output might even
+differ with regard to actually computed digits.
 
 It should be clear that objects of class @code{numeric} should be used
 for constructing numbers or for doing arithmetic with them.  The objects