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

• To: mathgroup at smc.vnet.net
• Subject: [mg92983] Re: [mg92968] Is there a simple way to transform 1.1 to 11/10?
• From: Bob Hanlon <hanlonr at cox.net>
• Date: Wed, 22 Oct 2008 05:37:01 -0400 (EDT)

```myRationalize[x_, n_Integer] :=
Round[x*10^n]/10^n

x = 1.000000001;

myRationalize[x, 9]

1000000001/1000000000

Bob Hanlon

---- Alain Cochard <alain at geophysik.uni-muenchen.de> wrote:

=============

The obvious

In:= x=1.1`Infinity

is not syntactically correct.

I understand that SetPrecision[1.1,Infinity] does not work either:

In:= SetPrecision[1.1,Infinity]

2476979795053773
Out= ----------------
2251799813685248

In:= N[%,20]

Out= 1.1000000000000000888

I searched the newsgroup and thought I had the solution with Rationalize:

In:= Rationalize[1.1,0]

11
Out= --
10

But

In:= Rationalize[1.000000001,0]

999999918
Out= ---------
999999917

In:= N[%,20]

Out= 1.0000000010000000830

So any simple way?

Thanks,
Alain

--

Bob Hanlon

```

• Prev by Date: Re: Is there a simple way to transform 1.1 to 11/10?
• Next by Date: Re: selecting sections (unix)
• 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?