MathGroup Archive 2010

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

Search the Archive

Re: Puzzled by IntegerPart

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114610] Re: Puzzled by IntegerPart
  • From: Ray Koopman <koopman at sfu.ca>
  • Date: Fri, 10 Dec 2010 02:29:58 -0500 (EST)
  • References: <idqcsa$ivb$1@smc.vnet.net>

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

The machine representation of 100*1.15 is < 115.

realbits = MapAt[StringJoin[ToString/@#]&,RealDigits[#,2,53],1]&;
realbits[115.]
realbits[100*1.15]
realbits[114.]

{11100110000000000000000000000000000000000000000000000,7}
{11100101111111111111111111111111111111111111111111111,7}
{11100100000000000000000000000000000000000000000000000,7}


  • Prev by Date: Importing Google Result Page into Mathematica
  • Next by Date: Re: Puzzled by IntegerPart
  • Previous by thread: Puzzled by IntegerPart
  • Next by thread: Re: Puzzled by IntegerPart