Return fixnum if sqrt(fixnum) is an exact int

This commit is contained in:
Justin Ethier 2024-03-12 19:06:54 -07:00
parent 32af1bcd05
commit 887e1e5aa9

View file

@ -111,6 +111,9 @@
}
if (cimag(result) == 0.0) {
if (obj_is_int(z) && creal(result) == round(creal(result))) {
return_closcall1(data, k, obj_int2obj(creal(result)));
}
make_double(d, creal(result));
return_closcall1(data, k, &d);
} else {