mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-24 19:19:57 +08:00
407c72cb29
* libF77/*: Fix formatting. * libI77/*: Likewise. * libU77/*: Likewise. From-SVN: r54145
25 lines
393 B
C
25 lines
393 B
C
#undef abs
|
|
#include <math.h>
|
|
double
|
|
f__cabs (double real, double imag)
|
|
{
|
|
double temp;
|
|
|
|
if (real < 0)
|
|
real = -real;
|
|
if (imag < 0)
|
|
imag = -imag;
|
|
if (imag > real)
|
|
{
|
|
temp = real;
|
|
real = imag;
|
|
imag = temp;
|
|
}
|
|
if ((real + imag) == real)
|
|
return (real);
|
|
|
|
temp = imag / real;
|
|
temp = real * sqrt (1.0 + temp * temp); /*overflow!! */
|
|
return (temp);
|
|
}
|