Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16568

Re: Possible bug in Floor function?

From Bill Rowe <readnews@sbcglobal.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Possible bug in Floor function?
Date 2014-02-16 04:02 +0000
Message-ID <ldpd8v$6n8$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


On 2/15/14 at 4:02 AM, s.nesseris@gmail.com (psycho_dad) wrote:

>I think I may have stumbled upon a possible bug in Floor. Evaluating
>the following gives the correct result:

>Floor[Log[10, 100.]]
>2

>Evaluating it with a replacement and //N gives a message and the
>wrong result:

>Floor[Log[10, x]] /. x -> 100 // N

>1

The problem isn't with Floor. The issue is simply the usage of
machine precision arithmetic. That is

In[11]:= RealDigits[Log[10, x] /. x -> 100 // N]

Out[11]= {{1,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},1}

As you can see, the result is just slightly less than 2. So, the
result Floor returns is correct

Back to comp.soft-sys.math.mathematica | Previous | NextNext in thread | Find similar


Thread

Re: Possible bug in Floor function? Bill Rowe <readnews@sbcglobal.net> - 2014-02-16 04:02 +0000
  Re: Possible bug in Floor function? Richard Fateman <fateman@cs.berkeley.edu> - 2014-02-18 03:30 +0000

csiph-web