From 76220e1e8ed67df58c3987554ccf853688e29a0a Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Sat, 28 Jun 2014 21:43:44 +0900 Subject: [PATCH] infinity is not rational --- src/number.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/number.c b/src/number.c index b8960466..c0a1e7ec 100644 --- a/src/number.c +++ b/src/number.c @@ -50,6 +50,10 @@ pic_number_integer_p(pic_state *pic) if (pic_float_p(v)) { double f = pic_float(v); + if (isinf(f)) { + return pic_false_value(); + } + if (f == round(f)) { return pic_true_value(); }