Re: Rationalize[] in Mathematica3 vs. Mathematica4
- To: mathgroup at smc.vnet.net
- Subject: [mg20249] Re: Rationalize[] in Mathematica3 vs. Mathematica4
- From: "Dana DeLouis" <dana2 at email.msn.com>
- Date: Fri, 8 Oct 1999 18:30:22 -0400
- References: <7t8cjs$gdr@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
I get the same results in Mathematica 4. I do not notice any documentation differences either. Is this another problem?? Add just 1 more zero in the middle of your number... Rationalize[0.60000000000000001,10^-50] or.. Rationalize[0.60000000000000001] then I get an exact answer of 3/5 ! If I add another 0 (or more) to the middle of your number, then It goes back to giving rational answers. Did you find a bug?? In Fact... Rationalize[0.60000000000000003,10^-50] gives 3/5 Rationalize[0.60000000000000004,10^-50] gives 1351079888093186 / 2251799813488643 Gianluca Gorni <gorni at dimi.uniud.it> wrote in message news:7t8cjs$gdr at smc.vnet.net... > > Hello! > > I have run Mathematica 4 on a program that I had tested with > Mathematica 3, and I noticed funny outputs. I traced the > problem to the function Rationalize[], which seems > to be different in the two version. > > With the following input > > In: Rationalize[0.6000000000000001`] > > Mathematica 3 gives > > Out: 3/5 > > while Mathematica 4 gives > > Out: 1351079888093186/2251799813488643 > > Is this change in behaviour intentional? > > To get the same result as before from my program > I had to write Rationalize[x, .001] instead of > Rationalize[x]. > > Gianluca Gorni > | mailto:gorni at dimi.uniud.it | > | http://www.dimi.uniud.it/~gorni |