Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: Is there a simple way to transform 1.1 to 11/10?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg92975] Re: [mg92968] Is there a simple way to transform 1.1 to 11/10?
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Wed, 22 Oct 2008 05:35:31 -0400 (EDT)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <200810211024.GAA04964@smc.vnet.net>
  • Reply-to: murray at math.umass.edu

But Rationalize IS a correct solution:

   fraction = Rationalize[1.1, 0];
   10 fraction === 11               (* SameQ *)
True

That seems to be proof that the result of Rationalize is exactly 11/10, 
with no issue of rounding or precision whatsoever.

Of course once you convert the result of Rationalize back to decimal, 
you encounter the usual limitations involving precision as well as the 
usual issue of decimal vs. binary.

Alain Cochard wrote:
> The obvious
> 
>     In[1]:= x=1.1`Infinity
> 
> is not syntactically correct.
> 
> I understand that SetPrecision[1.1,Infinity] does not work either:
> 
>     In[3]:= SetPrecision[1.1,Infinity]
> 
>             2476979795053773
>     Out[3]= ----------------
>             2251799813685248
> 
>     In[4]:= N[%,20]
> 
>     Out[4]= 1.1000000000000000888
> 
> I searched the newsgroup and thought I had the solution with Rationalize:
> 
>     In[5]:= Rationalize[1.1,0]
> 
>             11
>     Out[5]= --
>             10
> 
> But
> 
>     In[9]:= Rationalize[1.000000001,0]
> 
>             999999918
>     Out[9]= ---------
>             999999917
> 
>     In[10]:= N[%,20]
> 
>     Out[10]= 1.0000000010000000830
> 
> So any simple way?
> 
> Thanks,
> Alain
> 

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: Speeding up a list construction
  • Next by Date: Re: partial Dividers?
  • Previous by thread: Re: Is there a simple way to transform 1.1 to 11/10?
  • Next by thread: Re: Is there a simple way to transform 1.1 to 11/10?