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"?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg26629] Re: [mg26515] How can I transform the number of 123.456 into "123.456"?
  • From: "Drago Ganic" <drago.ganic at in2.hr>
  • Date: Sat, 13 Jan 2001 22:36:09 -0500 (EST)
  • Organization: HiNet
  • References: <200101010732.CAA09656@smc.vnet.net> <92uqmk$drv@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

"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"?