DragonFly users List (threaded) for 2007-05
Re: libm update plans?
On 2007-05-07 16:45, Matthew Dillon wrote:
:3) port over myself (see #1, #2 :)
I looked for various pieces of example code. FreeBSD has a really
old implementation in (libmsun) which is not suitable, and NetBSD uses
the same implementation. Gnu seems to have a clean 4-line implementation
done in 2005:
But I'd like to find an unadulterated version if possible (though
presumably it is simple enough that it pretty much has to be done
that way regardless).
I'm a little concerned that there are so few implementations around.
Are you sure this is part of C99?
Yes it it, section 188.8.131.52: "The trunc functions round their argument
to the integer value, in floating format, nearest to but no larger in
magnitude than the argument."
I've never been an assembly programmer but it seems to me like there
should be some instruction for this kind of thing.