diff options
author | Kevin Ryde <user42@zip.com.au> | 2003-04-23 23:43:47 +0200 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2003-04-23 23:43:47 +0200 |
commit | 55e155a8755dd869bb2d7a80cb0e75ace8cf75da (patch) | |
tree | 93f26ee754de72ba99b5b29ef26bd78f53533214 /mpf/set_d.c | |
parent | cf900ae3fb8f8bd2bafa39bf4ad09922bdeef7a2 (diff) | |
download | gmp-55e155a8755dd869bb2d7a80cb0e75ace8cf75da.tar.gz |
* mpz/set_d.c, mpq/set_d.c, mpf/set_d.c: Nan or Inf invalid.
Diffstat (limited to 'mpf/set_d.c')
-rw-r--r-- | mpf/set_d.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/mpf/set_d.c b/mpf/set_d.c index 9a8ff35a7..f639496c2 100644 --- a/mpf/set_d.c +++ b/mpf/set_d.c @@ -1,6 +1,6 @@ -/* mpf_set_d -- Assign a float from a IEEE double. +/* mpf_set_d -- Assign a float from a double. -Copyright 1993, 1994, 1995, 1996, 2001 Free Software Foundation, Inc. +Copyright 1993, 1994, 1995, 1996, 2001, 2003 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -19,6 +19,12 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "config.h" + +#if HAVE_FLOAT_H +#include <float.h> /* for DBL_MAX */ +#endif + #include "gmp.h" #include "gmp-impl.h" @@ -27,6 +33,10 @@ mpf_set_d (mpf_ptr r, double d) { int negative; + DOUBLE_NAN_INF_ACTION (d, + __gmp_invalid_operation (), + __gmp_invalid_operation ()); + if (d == 0) { SIZ(r) = 0; |