Comment #4 on issue 3579 by [email protected]: Math.log2 and Math.log10 should be exact for exact powers
https://code.google.com/p/v8/issues/detail?id=3579

for (var i = 0, k = 1; i < 70; ++i, k *= 2) { var s = String(Math.log2(k)); if (i != s) console.log("Math.log2(2^" + i + ") = " + s); }
Math.log2(2^3) = 2.9999999999999996 VM408:2
Math.log2(2^6) = 5.999999999999999 VM408:2
Math.log2(2^7) = 6.999999999999999 VM408:2
Math.log2(2^12) = 11.999999999999998 VM408:2
Math.log2(2^13) = 12.999999999999998 VM408:2
Math.log2(2^14) = 13.999999999999998 VM408:2
Math.log2(2^24) = 23.999999999999996 VM408:2
Math.log2(2^26) = 25.999999999999996 VM408:2
Math.log2(2^28) = 27.999999999999996 VM408:2
Math.log2(2^48) = 47.99999999999999 VM408:2
Math.log2(2^52) = 51.99999999999999 VM408:2
Math.log2(2^55) = 55.00000000000001 VM408:2
Math.log2(2^56) = 55.99999999999999 VM408:2
Math.log2(2^59) = 59.00000000000001 VM408:2
Math.log2(2^63) = 62.99999999999999 VM408:2


for (var i = 0, k = 1; i < 70; ++i, k *= 10) { var s = String(Math.log10(k)); if (i != s) console.log("Math.log10(2^" + i + ") = " + s); }
Math.log10(2^15) = 14.999999999999998 VM412:2
Math.log10(2^29) = 28.999999999999996 VM412:2
Math.log10(2^30) = 29.999999999999996 VM412:2
Math.log10(2^58) = 57.99999999999999 VM412:2
Math.log10(2^60) = 59.99999999999999 VM412:2
Math.log10(2^61) = 61.00000000000001 VM412:2
Math.log10(2^63) = 62.99999999999999 VM412:2


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to