MCPcopy Create free account
hub / github.com/numpy/numpy / f__cabs

Function f__cabs

numpy/linalg/lapack_lite/f2c.c:72–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70#undef abs
71
72double f__cabs(double real, double imag)
73#endif
74{
75double temp;
76
77if(real < 0)
78 real = -real;
79if(imag < 0)
80 imag = -imag;
81if(imag > real){
82 temp = real;
83 real = imag;
84 imag = temp;
85}
86if((imag+real) == real)
87 return((double)real);
88
89temp = imag/real;
90temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/
91return(temp);
92}
93
94 VOID
95#ifdef KR_headers

Callers 2

c_absFunction · 0.85
z_sqrtFunction · 0.85

Calls 1

sqrtFunction · 0.50

Tested by

no test coverage detected