MathGroup Archive 2014

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

Search the Archive

Re: Possible bug in Floor function?

On Sat, Feb 22, 2014 at 03:03:53AM -0500, John Doty wrote:
> On Wednesday, February 19, 2014 1:43:20 AM UTC-5, Itai Seggev wrote:
> > It's not a bug per se, but it is a somewhat unfortunate edge case.  No one has
> >
> > really hit on the fundamental issue,
> I hit on it in my post in this thread, and you didn't address one one the

Yes you did, although your email made it to the list after I had sent my email.

> important details here. Let me repeat: 
> Floor[] seems to have no trouble with other hairy expressions that happen to equal integers, for example "((-1)^(1/3) + (-1)^(2/3))/Sqrt[-3]". But a mere Simplify[] reduces that to 1. Perhaps that's where the real bug is. Does Floor[] try Simplify[]? Maybe Simplify[] should be transforming things like Log[100]/Log[10].

No, Floor doesn't use Simplify.  It uses adaptive numerical approximation.
It's just that for your hidden integer, it gets an answer it can verify (on its
first attempt, no less), whereas for the Log case that started the threade it
can't verify its answer and defaults to raw machine arithmetic.

As to whether Simplify should undo Logs, I don't know.  I don't know enough
about the internals for Simplify vs FullSimplify and where we draw the line to
comment intelligently on that point.  I can certainly pass it along as
suggestion to the relevant developer.

Itai Seggev
Mathematica Algorithms R&D

  • Prev by Date: Re: can we use ListVectorPlot to plot arrows? (tail at
  • Next by Date: Re: Some linear constraints seem to be ignored in function
  • Previous by thread: Re: Possible bug in Floor function?
  • Next by thread: Re: Possible bug in Floor function?