Re: Re: floor problems
- To: mathgroup at smc.vnet.net
- Subject: [mg8266] Re: [mg8176] Re: floor problems
- From: ross at mpce.mq.edu.au (Ross Moore)
- Date: Sat, 23 Aug 1997 01:59:04 -0400
- Sender: owner-wri-mathgroup at wolfram.com
>Tom (toad at planet.eon.net) wrote:
>: Hello Mathematica users.
>
...[deleted]...
>
>Mathematica is NOT making a mistake, even though if you simply ask for
>the products .7 67 10 and 67 10 .7 you get the same output 469. This
>is an inherent problem with approximate machine arithmetic -- it is
>NOT associative! And .7 does not have an exact binary representation
>(no matter how many bits of precision you might want).
>
>To see what's happening, you can look at the actual binary
>representation of the two products. Do
>
>$NumberBits[.7 67 10]
>$NumberBits[67 10 .7]
>
>and you will get different results. Evidently, when Mathematica takes
>the floor (of the binary representation), it therefore gets different
>results.
I beg to differ on the *will* here.
I think *may* is more apt. :-)
What kind of Macintosh were you using, Tom ?
I tried this on a PowerMac (604) with Mathematica 2.2
and also on a PowerBook 540c with Mathematica 3.0
Both gave the same correct answer of 469
and both gave identical results from $NumberBits ...
...though the PowerMac and PowerBook actually produced
different output with $NumberBits :
Each claimed 9-bit precision, but differed from the 9th bit onwards:
PowerMac: 11101010100000.... ( 64 bits in all )
PowerBook: 11101010011111... ...1100 ( 53 consecutive 1s )
Nice example of ...
>Welcome to the world of numerical analysis where, as one wit put it,
>no number that anyone really cares about has ever been calculated exactly.
I like it.
Regards,
Ross Moore
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ross Moore email: ross at mpce.mq.edu.au
Mathematics Department phone: +612 9850 8955
Macquarie University fax: +612 9850 8114
Sydney, NSW 2109 Internet:
Australia http://www-math.mpce.mq.edu.au/~ross/
***************************
for the best in (La)TeX-nical typesetting and Web page production
join the TeX Users Group (TUG) --- browse at http://www.tug.org
<ross.moore at mail.tug.org>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~