9d8b5fa74e
Most complex function implementations are from the "c9x-complex" library, originating from the "cephes" math library, see http://www.netlib.org/cephes/, from Stephen L. Moshier, incorporated and redistributed with the NetBSD license by permission of the author. Error behaviour and other boundary conditions (branch cuts) need to be looked at. For namespace sanity, I've done the rename/weak alias procedure to most of the exported functions which are also used internally. Didn't do so for sin/cos(f) yet because assembler implementations use them directly, and renaming functions shared between the main libm and the machine specific "overlay" might raise binary compatibility issues.
18 lines
290 B
C
18 lines
290 B
C
/* $NetBSD: cabsf.c,v 1.1 2007/08/20 16:01:30 drochner Exp $ */
|
|
|
|
/*
|
|
* Written by Matthias Drochner <drochner@NetBSD.org>.
|
|
* Public domain.
|
|
*/
|
|
|
|
#include "../src/namespace.h"
|
|
#include <complex.h>
|
|
#include <math.h>
|
|
|
|
float
|
|
cabsf(float complex z)
|
|
{
|
|
|
|
return hypotf(__real__ z, __imag__ z);
|
|
}
|