I would like to specify the precision of my numbers in binary digits
rather than decimal digits. Is there any way of doing this?
Many thanks,
Fergal.
--
====================================================================
Fergal Shevlin Phone: +353-1-6081209 Fax: 6772204
Dept. of Computer Science http://www.cs.tcd.ie/
Trinity College, Dublin 2, Ireland. Fergal....@cs.tcd.ie
The precision of numbers is kept in Mathematica as a real quantity.
This
means that you can easily specify a precision in binary digits by
multiplying
by Log[10.,2.]. For example
In[1]:= InputForm[SetPrecision[1/7,20*Log[10.,2.]]]
Out[1]//InputForm= 0.142857142857142849`6.0206
In[2]:= 6.0206*Log[2.,10.]
Out[2]= 20.
The InputForm gives you the fractional (with repect to base 10)
precision,
If you use the command Precision, this is rounded to the nearest
integer,
so the conversion won't appear quite correctly. In the next version of
Mathematica there will be options that allow you to prevent this
rounding.
Rob Knapp
Wolfram Research