Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Topic: Possible bug in Floor function?
Replies: 9   Last Post: Mar 2, 2014 1:50 AM

 Messages: [ Previous | Next ]
 Matthias Bode Posts: 84 Registered: 3/16/05
Re: Possible bug in Floor function?
Posted: Feb 15, 2014 11:02 PM

Hola,

the "salient point":

In[1]:= Log[1000, 1000000]
Floor[Log[1000., x]] /. x -> 1000000
N[Floor[Log[1000., x]] /. x -> 1000000]
N[Floor[Log[1000, x]] /. x -> 1000000]
Floor[Log[1000, x]] /. x -> 1000000

Out[1]= 2

Out[2]= 2

Out[3]= 2.

During evaluation of In[1]:= Floor::meprec:Internal precision limit \$MaxExtraPrecision = 50.` reached while evaluating Floor[Log[1000000]/Log[1000]]. >>

Out[4]= 2

During evaluation of In[1]:= Floor::meprec:Internal precision limit \$MaxExtraPrecision = 50.` reached while evaluating Floor[Log[1000000]/Log[1000]]. >>

Out[5]= Floor[Log[1000000]/Log[1000]]

But not reliably so:

In[1]:= Log[100, 10000]
Floor[Log[100., x]] /. x -> 10000
N[Floor[Log[100., x]] /. x -> 10000]
N[Floor[Log[100, x]] /. x -> 10000]
Floor[Log[100, x]] /. x -> 10000

Out[1]= 2

Out[2]= 1

Out[3]= 1.

During evaluation of In[1]:= Floor::meprec:Internal precision limit \$MaxExtraPrecision = 50.` reached while evaluating Floor[Log[10000]/Log[100]]. >>

Out[4]= 1

During evaluation of In[1]:= Floor::meprec:Internal precision limit \$MaxExtraPrecision = 50.` reached while evaluating Floor[Log[10000]/Log[100]]. >>

Out[5]= Floor[Log[10000]/Log[100]]

In[7]:= \$Version

Out[7]= "9.0 for Microsoft Windows (64-bit) (January 25, 2013)"

Best regards,

MATTHIAS BODE.
S 17.36398
W 66.218162'590 m. AMSL.
> From: s.nesseris@gmail.com
> Subject: Possible bug in Floor function?
> To: mathgroup@smc.vnet.net
> Date: Sat, 15 Feb 2014 04:02:14 -0500
>
> Hi,
>
> 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
>
> Floor::meprec: Internal precision limit \$MaxExtraPrecision = 50.` reached while evaluating Floor[Log[100]/Log[10]]. >>
>
> 1
>
> I'm on Math 9.0 + Win7, but Math 8 gives the same (wrong) result as well.
>
> Cheers
>

Date Subject Author
2/15/14 Matthias Bode
2/15/14 Bill Rowe
2/17/14 Richard Fateman
2/15/14 Bob Hanlon
2/17/14 Noqsi
2/19/14 Itai Seggev
2/22/14 Noqsi
2/23/14 Itai Seggev
3/2/14 Noqsi