Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: how to explain this weird effect? Integrate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg46544] Re: how to explain this weird effect? Integrate
  • From: "David W. Cantrell" <DWCantrell at sigmaxi.org>
  • Date: Mon, 23 Feb 2004 02:15:37 -0500 (EST)
  • References: <20040218182324.673$gV@newsreader.com> <c11se0$nkq$1@smc.vnet.net> <c14738$4bt$1@smc.vnet.net> <c16mc3$5q1$1@smc.vnet.net> <c1am0c$3oe$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

drbob at bigfoot.com (Bobby R. Treat) wrote concerning the bug which causes
Limit[Floor[Cos[x]], x -> 0] to give 1, rather than 0:

> The problem with Floor[Cos[x]] may be related to this situation:
>
> Floor[1 - 10.^(-17)]
> 1

Thanks. Yes, it might be related to that. But it _shouldn't_ be related
since everything in Limit[Floor[Cos[x]], x -> 0] is _exact_.

BTW, I doesn't trouble me -- well, at least, not much -- that
Floor[1 - 10.^(-17)] yields 1 . I've often mentioned (although perhaps not
in this newsgroup) that using discontinuous functions such as Floor in
floating-point arithmetic is _inherently_ perilous. One needs to learn to
expect things like Floor[1 - 10.^(-17)] possibly being 1 .

OTOH, note that Mathematica correctly gives 0 for Floor[1 - 10^(-17)] .
Since everything there was exact, I would have been greatly troubled if
Mathematica hadn't gotten that right.

David


  • Prev by Date: Help with Export function
  • Next by Date: Attributes and behaviors?
  • Previous by thread: Re: how to explain this weird effect? Integrate
  • Next by thread: Estimating parameters p and q in y'' + p y' + q y = Tide(t)