Support for C99 complex type required

Rainer Hurling rhurlin at gwdg.de
Mon Feb 14 10:08:43 UTC 2011


Am 14.02.2011 10:18 (UTC+1) schrieb Murray Stokely:
> On Mon, Feb 7, 2011 at 12:08 PM, David Schultz<das at freebsd.org>  wrote:
>> The 'complex' type and rudimentary operations on complex numbers
>> are supported, but the math library is missing all of the
>> transcendental functions on complex numbers.  There is some
>> ongoing work in the area, but due to time constraints, it will
>> likely be a while before we have complete support.  In the mean
>> time, you can see /usr/include/complex.h for a list of supported
>> functions.  I recall someone mentioning that there is a port that
>> provides most of the missing functionality.
>
> Hi David,
>
> Is there any reason we can't pull in these missing libm routines from
> NetBSD?  They seem to have pulled in code from netlib and gotten
> permission to relicense it under the BSD license.  E.g. here is one of
> the functions our FreeBSD 9 libm still lacks AFAICT:
>
>    http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libm/complex/cexp.c?only_with_tag=MAIN
>

Brian Ripley explained at r-devel at r-project.org (02/07/2011), that there 
are some problems with code taken from NetBSD and put into Cygwin:

"Cygwin has recently[*] added support for C99 complex math, taken from 
NetBSD with code that is very similar to that from Steven Moshier 
available via http://www.moshier.net/c9x_readme.html.

That code isn't entirely right, especially not at the cuts on the 
inverse functions where C99 mandates what cut is used (and neither glibc 
nor Mac OS X have it correct).

[*] AFAICS not yet released in Cygwin, but in newlib 1.19.0."


> Also, Darwin seems to have picked up much of there C99 math support
> from NetBSD as well, although it appears they've added more under an
> APSL license and they provide assembly language code for Intel, Arm,
> and PowerPC :
>
>    http://www.opensource.apple.com/source/Libm/Libm-315/Source/Intel/
>    http://www.opensource.apple.com/source/Libm/Libm-315/Source/complex.h
>
> Pulling in the APSL code may be a bit more controversial (though I
> think warranted), but pulling in code from NetBSD seems like a no
> brainer given that this standard is over a decade old and modern
> software like Mplayer, R, etc depend on the newer C99 functions.
>
> Does the ongoing work in this area you describe involve porting the
> NetBSD code or are you talking about another implementation?
>
>                     - Murray


More information about the freebsd-standards mailing list