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