Fix scheme for (integer? 7.0) which should return #t

This commit is contained in:
Mukund Sivaraman 2010-11-20 12:38:58 +05:30
parent e4a96c738e
commit cfde98394c
1 changed files with 8 additions and 1 deletions

View File

@ -3783,7 +3783,14 @@ static pointer opexe_3(scheme *sc, enum scheme_opcodes op) {
case OP_STRINGP: /* string? */ case OP_STRINGP: /* string? */
s_retbool(is_string(car(sc->args))); s_retbool(is_string(car(sc->args)));
case OP_INTEGERP: /* integer? */ case OP_INTEGERP: /* integer? */
s_retbool(is_number(car(sc->args)) && is_integer(car(sc->args))); x = car(sc->args);
if (!is_number(x))
s_retbool(0);
if (is_real(x)) {
double r = rvalue(x);
s_retbool(r == round_per_R5RS(r));
}
s_retbool(is_integer(x));
case OP_REALP: /* real? */ case OP_REALP: /* real? */
s_retbool(is_number(car(sc->args))); /* All numbers are real */ s_retbool(is_number(car(sc->args))); /* All numbers are real */
case OP_CHARP: /* char? */ case OP_CHARP: /* char? */