standards/59797: Implement C99's round[f]() math fucntions
Steven G. Kargl
kargl at troutmask.apl.washington.edu
Mon Jun 7 01:33:54 GMT 2004
David Schultz wrote:
>
> BTW, benchmarking shows that using the sample implementation that
> appears in the C99 standard results in a slowdown of two orders of
> magnitude over your round() implementation and four orders of
> magnitude over the x87 frndint instruction. Just setting the
> rounding mode and calling rint() also results in a significant
> slowdown. Thus, we definitely want something that's in the spirit
> of what you wrote, but perhaps one that operates on the bits directly.
>
I looked at the glibc implementation of round(). It does
bit twiddling, but I would definitely recommend not using
the glibc version because of licensing and possible copyright
infringement concerns [hiint compare glibc's round() with
fdlibm's ceil()].
--
Steve
http://troutmask.apl.washington.edu/~kargl/
More information about the freebsd-standards
mailing list