lua-users home
lua-l archive

Re: Why do some math functions return -0

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 21 Sep 2010, at 02:35, Mike Pall <mikelu-1009@mike.de> wrote:
> 
> Also note that your finding is unrelated to the problem at hand
> (no constant folding, no change of rounding mode). There's some
> prior evidence of buggy or miscompiled floor/ceil for OSX/PPC:
> 
That explains it :-) I was wrong to blame rounding in general, but that was the only explanation I could think of late at night for subtraction giving -0 in the default rounding mode (nearest). Inconsistent constant folding effects are a red herring too because they don't explain the weird behaviour of Lua (where compile time constants aren't involved) but broken floor() does explain that.
Tony.
--
f.anthony.n.finch <dot@dotat.at> http://dotat.at/

AltStyle によって変換されたページ (->オリジナル) /