mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 14:00:21 +02:00
* numbers.c (isfinite): Define this macro if not defined: Return a
non-zero value if X is finite. (From ISO C 9x standard.) (scm_inexact_to_exact): Bugfix: Don't pass NaNs to scm_dbl2big. (Thanks to Jon Trowbridge and Greg Harvey.)
This commit is contained in:
parent
3668b8c783
commit
e6f3ef586c
1 changed files with 7 additions and 1 deletions
|
@ -58,6 +58,12 @@
|
|||
#define IS_INF(x) ((x) == (x) / 2)
|
||||
#endif
|
||||
|
||||
/* Return true if X is not infinite and is not a NaN
|
||||
*/
|
||||
#ifndef isfinite
|
||||
#define isfinite(x) (!IS_INF (x) && (x) == (x))
|
||||
#endif
|
||||
|
||||
/* MAXEXP is the maximum double precision expontent
|
||||
* FLTMAX is less than or scm_equal the largest single precision float
|
||||
*/
|
||||
|
@ -4489,7 +4495,7 @@ scm_inexact_to_exact (z)
|
|||
if (SCM_INUM (ans) == (long) u)
|
||||
return ans;
|
||||
}
|
||||
SCM_ASRTGO (!IS_INF (u), badz); /* problem? */
|
||||
SCM_ASRTGO (isfinite (u), badz); /* problem? */
|
||||
return scm_dbl2big (u);
|
||||
}
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue