diff options
author | Toon Moene <toon@moene.indiv.nluug.nl> | 2000-03-12 19:20:47 +0000 |
---|---|---|
committer | Toon Moene <toon@gcc.gnu.org> | 2000-03-12 19:20:47 +0000 |
commit | 6973bf5482d8a5a150c3ee1424bf7e154e61dd51 (patch) | |
tree | 2f96ba2bc116769c43eb3433f6fa7f616e56586d /libf2c/libF77/z_div.c | |
parent | 66e86e32ab9ff17888ed0d05fcb090f2c37c73a0 (diff) | |
download | gcc-6973bf5482d8a5a150c3ee1424bf7e154e61dd51.zip gcc-6973bf5482d8a5a150c3ee1424bf7e154e61dd51.tar.gz gcc-6973bf5482d8a5a150c3ee1424bf7e154e61dd51.tar.bz2 |
configure.in: Define IEEE_COMPLEX_DIVIDE.
* libF77/configure.in: Define IEEE_COMPLEX_DIVIDE.
* libF77/[cz]_div.c: Arrange for compilation under
-DIEEE_COMPLEX_DIVIDE to make these routines
avoid calling sig_die when the denominator vanishes.
* libF77/s_rnge.c: Add casts for the case of
sizeof(ftnint) == sizeof(int) < sizeof(long).
* libI77/endfile.c: Set state to writing (b->uwrt = 1) when an
endfile statement requires copying the file
Also, supply a missing (long) cast in the sprintf call.
* libI77/sfe.c: Add #ifdef ALWAYS_FLUSH logic, for formatted I/O.
From-SVN: r32496
Diffstat (limited to 'libf2c/libF77/z_div.c')
-rw-r--r-- | libf2c/libF77/z_div.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libf2c/libF77/z_div.c b/libf2c/libF77/z_div.c index 22153fa..e14df32 100644 --- a/libf2c/libF77/z_div.c +++ b/libf2c/libF77/z_div.c @@ -17,8 +17,16 @@ void z_div(doublecomplex *c, doublecomplex *a, doublecomplex *b) abi = - abi; if( abr <= abi ) { - if(abi == 0) + if(abi == 0) { +#ifdef IEEE_COMPLEX_DIVIDE + if (a->i != 0 || a->r != 0) + abi = 1.; + c->i = c->r = abi / abr; + return; +#else sig_die("complex division by zero", 1); +#endif + } ratio = b->r / b->i ; den = b->i * (1 + ratio*ratio); cr = (a->r*ratio + a->i) / den; |