infinity is not rational

This commit is contained in:
Yuichi Nishiwaki 2014-06-28 21:43:44 +09:00
parent 1a1d380a78
commit 76220e1e8e
1 changed files with 4 additions and 0 deletions

View File

@ -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();
}