Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Matthias Bode

Posts: 84
Registered: 3/16/05
Re: Possible bug in Floor function?
Posted: Feb 15, 2014 11:02 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


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
>




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.