MathGroup Archive 2004

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

Search the Archive

Re: bug in IntegerPart ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg47849] Re: bug in IntegerPart ?
  • From: ancow65 at yahoo.com (AC)
  • Date: Thu, 29 Apr 2004 00:35:03 -0400 (EDT)
  • References: <c6g015$4lk$1@smc.vnet.net> <200404260641.CAA06324@smc.vnet.net> <c6l7kr$ink$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Andrzej Kozlowski <akoz at mimuw.edu.pl> wrote in message news:<c6l7kr$ink$1 at smc.vnet.net>...
> On 26 Apr 2004, at 15:41, AC wrote:
> 
> > "DrBob" <drbob at bigfoot.com> wrote in message 
> > news:<c6g015$4lk$1 at smc.vnet.net>...
> >> There's NO reason to be puzzled. 1.65 and 1.3 can't be represented 
> >> exactly
> >> in binary, so of course their difference may not be exact, either. 
> >> Hence the
> >> division problems have different numerators.
> >
> > Your 'explanation' makes no sense whatsoever. Mathematica's binary
> > representations of 1.65-1.3 and 0.35 are the same. That can be seen by
> > comparing
> >   BaseForm[1.65 - 1.3, 2]
> > with
> >   BaseForm[0.35,2]
> >
> It does make sense and certainly not the same!

Binary representations of decimal numbers existed long before
Mathematica was inception. Prof. Kozlowski, would you please prove,
without using Mathematica, that the binary representations of 1.65-1.3
and .35 are indeed different?

I claim that they are IDENTICAL and only Mathematica MAKES them
different because it transforms 1.65 and 1.3 into truncated binary
representations BEFORE subtraction.

AC

> 
> In[23]:=
> FullForm[BaseForm[0.35, 2]]
> 
> Out[23]//FullForm=
> BaseForm[0.35`,2]
> 
> In[24]:=
> FullForm[BaseForm[1.65 - 1.3, 2]]
> 
> Out[24]//FullForm=
> BaseForm[0.34999999999999987`,2]
> 
> Or just evaluate BaseForm using INputform for output. You should not 
> trust in such cases  what you see in StandardForm or TraditionalForm. 
> In fact RealDigits[,2] gives you the relevant information.
> 
> 
> Andrzej Kozlowski
> Chiba, Japan
> http://www.mimuw.edu.pl/~akoz/


  • Prev by Date: Gaussian integration broken - bug 4
  • Next by Date: Re: Wrong Limit
  • Previous by thread: Re: bug in IntegerPart ?
  • Next by thread: Re: bug in IntegerPart ?