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: [mg92979] Re: Is there a simple way to transform 1.1 to 11/10?
  • From: dh <dh at metrohm.ch>
  • Date: Wed, 22 Oct 2008 05:36:18 -0400 (EDT)
  • References: <gdkajv$4r2$1@smc.vnet.net>




Hi Alain,

Rationalize[x,0] does not give a rational approx. without errors as the 

"0" may imply. Instead it gives an approximation with the precision of 

x. Even Rationalize[x,dx] does at most give an approximation with a 

precision of x (even if dx is smaller).

hope this helps, Daniel



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

> 





-- 



Daniel Huber

Metrohm Ltd.

Oberdorfstr. 68

CH-9100 Herisau

Tel. +41 71 353 8585, Fax +41 71 353 8907

E-Mail:<mailto:dh at metrohm.com>

Internet:<http://www.metrohm.com>




  • Prev by Date: Re: Speeding up a list construction
  • Next by Date: Re: Speeding up a list construction
  • 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?