Setting Precision in Binary Digits
Q: I would like to specify the precision of my numbers in binary digits rather than decimal digits. Is there any way of doing this?
A: Rob Knapp (firstname.lastname@example.org) answers: The precision of numbers in Mathematica is kept as a real quantity. This means that you can easily specify a precision in binary digits by multiplying it by . For example, here we specify to 20 binary digits.
Using FullForm gives you the fractional (with respect to base 10) precision.
By default, Precision rounds to the nearest integer.
In Mathematica 4 there is an option to prevent this rounding.
If we examine the RealDigits of n in base 2,
we see that there are 20 binary digits.
Another way to display the same information is using BaseForm.
You can enter a number in an arbitrary base using base^^digits see Sections 3.1.3 and A.2.5 of The Mathematica Book).
The result is identical to that obtained using SetPrecision.
Converted by Mathematica September 29, 1999 [Prev Page][Next Page]