Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: Puzzled by IntegerPart

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114605] Re: Puzzled by IntegerPart
  • From: Sebastian <sebhofer at gmail.com>
  • Date: Fri, 10 Dec 2010 02:29:03 -0500 (EST)
  • References: <idqcsa$ivb$1@smc.vnet.net>

On Dec 9, 12:00 pm, Themis Matsoukas <tmatsou... at me.com> wrote:
> IntegerPart[100*1.15]
>
> 114
>
> ???
>
> Themis

I was going to say: Mathematica seems to floor numeric quantities
(which would kindof make sense to me), e.g.
In[86]:= IntegerPart[100*1.13]
IntegerPart[100*(1.13 + $MachineEpsilon)]

Out[86]= 112

Out[87]= 113

In[88]:= Floor[100*1.13]
Floor[100*(1.13 + $MachineEpsilon)]

Out[88]= 112

Out[89]= 113

On the other hand...
In[90]:= IntegerPart[100*1.12]
IntegerPart[100*(1.12 + $MachineEpsilon)]

Out[90]= 112

Out[91]= 112

In[92]:= Floor[100*1.12]
Floor[100*(1.12 + $MachineEpsilon)]

Out[92]= 112

Out[93]= 112
... so I'm also puzzled.


  • Prev by Date: Re: Puzzled by IntegerPart
  • Next by Date: Re: Are these bugs fixed in Mathematica 8 ?
  • Previous by thread: Re: Puzzled by IntegerPart
  • Next by thread: Re: Puzzled by IntegerPart