DragonFly users List (threaded) for 2007-05
DragonFly BSD
DragonFly users List (threaded) for 2007-05
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: libm update plans?


From: Erik Wikström <erik-wikstrom@xxxxxxxxx>
Date: Mon, 07 May 2007 18:17:44 +0200

On 2007-05-07 16:45, Matthew Dillon wrote:
:3) port over myself (see #1, #2 :)
:
:Thanks,
:
:- Chris

Hmmm.

    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:

http://gcc.gnu.org/ml/fortran/2005-05/msg00227.html

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 7.12.9.8: "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.

--
Erik Wikström



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