diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2013-01-18 07:59:22 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2013-01-18 07:59:22 +0000 |
commit | 8118b1b3be31a537d3c5f622f817a75a10c27741 (patch) | |
tree | 47d6eff7889e729dd603f80f5cd817c3386723ae /Build/source/utils/pmx/pmx-2.6.19/libf2c/cabs.c | |
parent | bd904730c4c0f4e593cb97725f11eaf36ec72162 (diff) |
pmx 2.6.19
git-svn-id: svn://tug.org/texlive/trunk@28859 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/pmx/pmx-2.6.19/libf2c/cabs.c')
-rw-r--r-- | Build/source/utils/pmx/pmx-2.6.19/libf2c/cabs.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Build/source/utils/pmx/pmx-2.6.19/libf2c/cabs.c b/Build/source/utils/pmx/pmx-2.6.19/libf2c/cabs.c new file mode 100644 index 00000000000..84750d505cf --- /dev/null +++ b/Build/source/utils/pmx/pmx-2.6.19/libf2c/cabs.c @@ -0,0 +1,33 @@ +#ifdef KR_headers +extern double sqrt(); +double f__cabs(real, imag) double real, imag; +#else +#undef abs +#include "math.h" +#ifdef __cplusplus +extern "C" { +#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); +} +#ifdef __cplusplus +} +#endif |