Re: Decimal math bug?
- To: mathgroup at smc.vnet.net
- Subject: [mg28853] Re: Decimal math bug?
- From: "Paul Lutus" <nospam at nosite.com>
- Date: Tue, 15 May 2001 00:59:28 -0400 (EDT)
- References: <qo2M6.11068$UE4.63708@ralph.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
"Jim Freeze" <jim at freeze.org> wrote in message news:qo2M6.11068$UE4.63708 at ralph.vnet.net... > On Sun, 13 May 2001, Murray Eisenberg wrote: > > > Don't think it's a program bug -- just yet one more manifestation of the > > wonders of roundoff in floating point arithemetic. In Mathematica 4.1 > > under Windows 2000: > > This 'round-off' happens under Linux. > But there is a self contradiction that should be considered > a bug. > > > (.53 + .9) - (1.43) > > 2.220446049250313*^-16 > > .53 + .9 = 1.4300000000000002 > 1.43 == 1.4300000000000002 is returned as true, > but 1.4300000000000002 - 1.43 is not zero. > Is not this a self contradiction. > > I can understand this as being a round off bug if using double > precision. But, since Mathematica has infinite precision, is there not some way > to invoke that on this operation and not use built in double > math and get the roundoff. Yep. (.53`32 + .9`32) - (1.43) The `32 part tells Mathematica to use 32 decimal places. -- Paul Lutus www.arachnoid.com