[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Fastest way to determine number is integer in plain Lua
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 7 Nov 2008 14:56:48 -0200
> Oh, and I wouldn't call the +-2^52 trick a hack. In fact all
> modern C compilers use a variation of it to implement floor(),
> ceil(), trunc() and round() if the FP is done in hardware, but
> doesn't have a special instruction for rounding (e.g. x87 does,
> SSE2 and most other FPUs don't).
Not being a hack for a compiler does not imply not being a hack for an
application. (Among other differences, compilers have fixed targets.)
-- Roberto