MathGroup Archive 1997

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

Search the Archive

Re: floor problems

  • To: mathgroup at smc.vnet.net
  • Subject: [mg8150] Re: [mg8113] floor problems
  • From: Lou Talman <me at talmanl.mscd.edu>
  • Date: Sat, 16 Aug 1997 11:50:54 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

Tom De Vries wrote:

> 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

The problem is not with Floor, but with the fact that floating point
multiplication of real numbers of fixed length is not, in general, associative:

In[1]:=
(.7 67 10) - (67 10 .7)

Out[1]=
\!\(5.68434188608080148`*^-14\)

--Lou Talman


  • Prev by Date: Re: Mathematica Journal
  • Next by Date: Re: floor problems
  • Previous by thread: RE: floor problems
  • Next by thread: Re: floor problems