MathGroup Archive 1997

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: floor problems

  • To: mathgroup at smc.vnet.net
  • Subject: [mg8228] Re: floor problems
  • From: bruck at pacificnet.net (Ronald Bruck)
  • Date: Tue, 19 Aug 1997 21:12:09 -0400
  • Organization: Univ of Southern Calif
  • Sender: owner-wri-mathgroup at wolfram.com

In article <5sos4i$gsq at smc.vnet.net>, Tom <toad at planet.eon.net> wrote:

:Hello Mathematica users.
:
:I had a very frustrating time trying to debug some work I was doing in
:Mathematica.  I finally pared it down to a problem with the Floor
:function, and I have illustrated my concern below.  I am using M 3.0 and
:a Mac computer.  Does anyone have any advice or could you tell me if I
:am doing something wrong?
:
:Floor[(.7 67 10)]
:
:469
:
:Floor[(67 10 .7)]
:
:468

Yes.  Floating-point multiplication is not associative.

If you set

   x = .7 67 10
   y = 67 10 .7

and evaluate x-469 and y-469 you'll see that x is exactly 469 and y isn't.  

Look at the bit patterns to see why.  This is with binary floating-point
arithmetic, of course.

--Ron Bruck

Now 100% ISDN from this address


  • Prev by Date: some abnormalities
  • Next by Date: log files on PowerMac (Q:)
  • Previous by thread: Re: floor problems
  • Next by thread: Re: floor problems