MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How can I transform the number of 123.456 into "123.456"?


"Tomas Garza" <tgarza01 at prodigy.net.mx> wrote in message news:92uqmk$drv at smc.vnet.net...

....
<< snip >>
....
> **However**, this approach will not work always, since Mathematica has an
> odd way to handle approximate numbers. For example,
> 
> In[6]:=
> RealDigits[345.89087]
> Out[6]=
> {{3, 4, 5, 8, 9, 0, 8, 7, 0, 0, 0, 0, 0, 0, 0, 0}, 3}
> 
> but
> 
> In[7]:=
> RealDigits[89087.345]
> Out[7]=
> {{8, 9, 0, 8, 7, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 1}, 5}
> 
> and now you get an unexpected (and undesirable) 1 at the end of the sequence
> of digits! 

....
<< snip >>
....
> 
> Tomas Garza
> Mexico City


Hi,

Tomas gave as an excelent example. 

Can somebody explain the behaviour of RealDigits [89087.345]  - the last number in the digits list!!!

Greetings from Croatia,
Drago Ganic




  • Prev by Date: Re: DO if Loop
  • Next by Date: Re: Fourier Transform and convolution.
  • Previous by thread: Re: How can I transform the number of 123.456 into "123.456"?
  • Next by thread: Re: How can I transform the number of 123.456 into "123.456"?