Commit a249c5eb authored by Ed Schouten's avatar Ed Schouten

Simply use __imag__ to implement cimag().

We already use this construct in cabs() to call hypot(), so I guess we
can assume our targeted compilers support this construct.
parent 08dbb2b5
......@@ -26,7 +26,6 @@
* $FreeBSD: src/lib/msun/src/s_cimag.c,v 1.3 2009/03/14 18:24:15 das Exp $
*/
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"
......@@ -34,7 +33,5 @@
DLLEXPORT double
cimag(double complex z)
{
const double_complex z1 = { .f = z };
return (IMAGPART(z1));
return (__imag__ z);
}
......@@ -26,7 +26,6 @@
* $FreeBSD: src/lib/msun/src/s_cimagf.c,v 1.3 2009/03/14 18:24:15 das Exp $
*/
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"
......@@ -34,7 +33,5 @@
DLLEXPORT float
cimagf(float complex z)
{
const float_complex z1 = { .f = z };
return (IMAGPART(z1));
return (__imag__ z);
}
......@@ -26,7 +26,6 @@
* $FreeBSD: src/lib/msun/src/s_cimagl.c,v 1.3 2009/03/14 18:24:15 das Exp $
*/
#include <openlibm.h>
#include <openlibm_complex.h>
#include "math_private.h"
......@@ -34,7 +33,5 @@
DLLEXPORT long double
cimagl(long double complex z)
{
const long_double_complex z1 = { .f = z };
return (IMAGPART(z1));
return (__imag__ z);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment