some more tests.

This commit is contained in:
Vitor Santos Costa 2010-02-26 09:12:20 +00:00
parent 21fb6091ea
commit c6ad678174

View File

@ -463,6 +463,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
RBIG_FL(floor(dbl));
}
case op_ceiling:
@ -490,6 +501,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
RBIG_FL(ceil(dbl));
}
case op_round:
@ -517,6 +539,17 @@ eval1(Int fi, Term t) {
#endif
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
RBIG_FL(my_rint(dbl));
}
case op_truncate: