Skip to content

Commit

Permalink
Return fixnum if sqrt(fixnum) is an exact int
Browse files Browse the repository at this point in the history
  • Loading branch information
justinethier committed Mar 13, 2024
1 parent 32af1bc commit 887e1e5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scheme/inexact.sld
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 887e1e5

Please sign in to comment.