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

Function f__cabsf

numpy/linalg/lapack_lite/f2c.c:43–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41#undef abs
42
43double f__cabsf(float real, float imag)
44#endif
45{
46float temp;
47
48if(real < 0.0f)
49 real = -real;
50if(imag < 0.0f)
51 imag = -imag;
52if(imag > real){
53 temp = real;
54 real = imag;
55 imag = temp;
56}
57if((imag+real) == real)
58 return((float)real);
59
60temp = imag/real;
61temp = real*sqrtf(1.0 + temp*temp); /*overflow!!*/
62return(temp);
63}
64
65
66#ifdef KR_headers

Callers 2

c_absFunction · 0.85
c_sqrtFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected