projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
syscons util remove use kbdcontrol & vidcontrol instead
[unix-history]
/
lib
/
libF77
/
cabs.c
diff --git
a/lib/libF77/cabs.c
b/lib/libF77/cabs.c
index
09e90af
..
8c14afd
100644
(file)
--- a/
lib/libF77/cabs.c
+++ b/
lib/libF77/cabs.c
@@
-7,21
+7,8
@@
double f__cabs(real, imag) double real, imag;
double f__cabs(double real, double imag)
#endif
{
double f__cabs(double real, double imag)
#endif
{
-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);
+struct {double x, y;} z;
+z.x = real;
+z.y = imag;
+return cabs(z);
}
}