I reworked the patch a bit as per Mark's comments. It takes care of the sign part and handles integer power values properly. It also fixes another bug with the current expt implementation where base is an integer and the power value is not (eg: (expt 2 2.0) gives an error in the current git master. The patch fixes this too.) Also adds some test cases. Please review. Thanks Ramakrishnan