Re: bigint and biginteger

2014-06-09 Thread Plínio Balduino
Thank you, Mark and Mike Awesome explanation and examples Plínio On Sat, Jun 7, 2014 at 8:46 AM, Mike Fikes wrote: > Thanks for the historical perspective, puzzler! > > In addition to performance considerations, Clojure Programming points to an > inconsistency between hash codes for longs and B

Re: bigint and biginteger

2014-06-07 Thread Mike Fikes
Thanks for the historical perspective, puzzler! In addition to performance considerations, *Clojure Programming* points to an inconsistency between hash codes for longs and BigIntegers as a motivation. Using the example number from that excellent book on Clojure 1.5.1 (on Java 8, FWIW), I ca

Re: bigint and biginteger

2014-06-06 Thread Mark Engelberg
Java has a class called java.math.BigInteger. Clojure's biginteger simply typecasts to the built-in java class. Several years ago, Clojure exclusively used java.math.BigInteger to handle integers larger than longs. Back then, Clojure's arithmetic operators would automatically overflow, so if you