handle integer(0.0/0.0) (obs from David Vaz).

This commit is contained in:
Vitor Santos Costa 2010-02-23 22:25:04 +00:00
parent 39785a72ce
commit eab72f6ab7
2 changed files with 12 additions and 1 deletions

View File

@ -555,6 +555,17 @@ eval1(Int fi, Term t) {
case db_ref_e:
RERROR();
}
#if HAVE_ISNAN
if (isnan(dbl)) {
return Yap_ArithError(DOMAIN_ERROR_OUT_OF_RANGE, t, "integer(%f)", dbl);
}
#endif
#if HAVE_ISNAN
if (isinf(dbl)) {
return Yap_ArithError(EVALUATION_ERROR_INT_OVERFLOW, MkFloatTerm(dbl), "integer\
(%f)",dbl);
}
#endif
if (dbl <= (Float)Int_MAX && dbl >= (Float)Int_MIN) {
RINT((Int) dbl);
} else {

@ -1 +1 @@
Subproject commit d9614e99dc98f8546fdc213c9e45003cf6efd520
Subproject commit 9f80255cce18ee268792631aa1180e19a496346f