>From b0445c6e497c175c2dee96948630a10b7a4c4aac Mon Sep 17 00:00:00 2001 From: Christian Kellermann Date: Fri, 16 Mar 2012 11:35:57 +0100 Subject: [PATCH] Check for isnan & isinf in C_u_i_fpintegerp --- chicken.h | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/chicken.h b/chicken.h index 9237e14..cd73152 100644 --- a/chicken.h +++ b/chicken.h @@ -2182,9 +2182,13 @@ C_inline C_word C_i_rationalp(C_word x) C_inline C_word C_u_i_fpintegerp(C_word x) { - double dummy; + double dummy, val; + + val = C_flonum_magnitude(x); - return C_mk_bool(C_modf(C_flonum_magnitude(x), &dummy) == 0.0); + if(C_isnan(val) || C_isinf(val)) return C_SCHEME_FALSE; + + return C_mk_bool(C_modf(val, &dummy) == 0.0); } -- 1.7.4.1