function log2(v) { return Math.log(v)/Math.LN2 }
log2(Number.MAX_VALUE) //=> 1024
The Log base 2 of the Maximum double floating point number is 1024. There is something elegant about that. My respect for IEEE 754 just went up.
I am exploring two new languages and a Distributed VCS. Go and Node.js. Go has Goroutines (sorta evented, sorta threaded) and Node.js is intrinsically event driven. Git is a VCS born of Linus Torvalds mind (tried Mercuria[hg] but git has won me and the majority over).
Saturday, June 23, 2012
IEEE 754 may not be such a kluge I thought it was
I just found out something elegant about double floating point numbers... or maybe this is just a Javascript thing.
Subscribe to:
Posts (Atom)