MathGroup Archive 2003

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

Search the Archive

Re: Lower Floor

  • To: mathgroup at smc.vnet.net
  • Subject: [mg39030] Re: Lower Floor
  • From: "David W. Cantrell" <DWCantrell at sigmaxi.org>
  • Date: Sat, 25 Jan 2003 01:24:33 -0500 (EST)
  • References: <b0r3j6$4jl$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

"André Giroux" <giroux at dms.umontreal.ca> wrote:
> Hi All.
> With Mathematica 4.1 on Windows98:
> N[Log[8]/Log[2]]
> 3.
> Floor[N[Log[8]/Log[2]]]
> 2
> Beware!

I don't find that surprising. After all, you asked for a numerical
approximation first!

Several comments (based on using version 4.2 for Windows):

(1) N[Log[8]/Log[2]] has FullForm 2.9999999999999996`, which, being less
than 3, must have its Floor equal to 2 of course.

(2) Floor[Log[8]/Log[2]] returns unevaluated, accompanied by a complaint
about uncertainty, while Floor[Log[2, 8]] yields 3, just as desire.

(3) N[Floor[Log[8]/Log[2]]] evaluates to 2., but again accompanied by a
complaint about uncertainty. (Such complaints are valuable.)

(4) FullSimplify[Floor[Log[8]/Log[2]]] evaluates to 3, just as we desire.

(5) It's simply a bad idea to ask for numerical approximations when you
are dealing with something in the vicinity of a jump discontinuity.
(Indeed, I think it could be argued that things like Floor[3.] should
actually be Indeterminate in Mathematica.)

David Cantrell


  • Prev by Date: Re: Simple Syntax Question
  • Next by Date: Gaussian intersection
  • Previous by thread: RE: Lower Floor
  • Next by thread: Re: Lower Floor