remove some more duplicated code

This commit is contained in:
Vitor Santos Costa
2013-11-22 15:18:03 +00:00
parent de606255bb
commit f6f183c0f6
16 changed files with 162 additions and 186 deletions

View File

@@ -233,23 +233,24 @@ static Term
float_send(char *s, int sign)
{
GET_LD
Float f = (Float)atof(s);
Float f = (Float)(sign*atof(s));
printf("buf=%s && f= %f\n", s, f);
#if HAVE_ISFINITE
if (truePrologFlag(PLFLAG_ISO)) { /* iso */
if (!isfinite(f)) {
LOCAL_ErrorMessage = "Float overflow while scanning";
return(MkEvalFl(0.0));
return(MkEvalFl(f));
}
}
#elif HAVE_FINITE
if (truePrologFlag(PLFLAG_ISO)) { /* iso */
if (!finite(f)) {
LOCAL_ErrorMessage = "Float overflow while scanning";
return(MkEvalFl(0.0));
return(MkEvalFl(f));
}
}
#endif
return (MkEvalFl(f*sign));
return (MkEvalFl(f));
}
/* we have an overflow at s */