(expt 3 3) tries to return 27 instead of 27.0 That is good However, this has an unexpected outcome:
(expt 2 -2) returns 0 instead of 0.25 I couldn,t understand the c code, but it seems to do this: /* don't promote to floats, if both are ints */ (if (and (integerp a) (integerp b)) (leave-them-be)) Perhaps it should add this condition to the above: (if (and (integerp a) (integerp b) (plusp b)) (leave-them-be)) . . . ==================================================== One might try to argue this to explain away the present behavior: the user shoud expect an integer if both inputs were integers. But if that were so, then conversely, (log 2 8) should return 0 and not .33333 ==================================================== i think that both should return the proper values instead of truncated integers., truncating to integers only has precedent when it comes to division (and even there, elisp differs from most other langages, including CL) ==================================================== In the case of expt, it looks like (?) the author never intended to return a truncated answer, he was just trying to be nice and return an integer for things line 3^3, and just overlooked the possibility of b being negative at this stage. _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel