Re: Suggest patch to math.clj - integer-length

2009-03-30 Thread Konrad Hinsen
On Mar 30, 2009, at 11:57, Mark Engelberg wrote: > This brings up an interesting question. Does Java guarantee that on > all architectures and all future versions that Integers will be 32-bit > and Longs will be 64-bit? > > I think the answer is yes, that this is part of the specification, but >

Re: Suggest patch to math.clj - integer-length

2009-03-30 Thread Mark Engelberg
This brings up an interesting question. Does Java guarantee that on all architectures and all future versions that Integers will be 32-bit and Longs will be 64-bit? I think the answer is yes, that this is part of the specification, but I'm not certain. --~--~-~--~~~-

Suggest patch to math.clj - integer-length

2009-03-29 Thread Hwijae Lee
I changed "integer-length" to use numberOfLeadingZeros or bitLength methods. It reduces execution time a bit. So that of "exact-integer-sqrt" too. ;; test with name integer-length-new (defmulti ;; #^{:private true} integer-length-new class) (defmethod integer-length-new java.lang.Integer [n]