Monthly Archives: December 2010

Unsigned comparisons in Java

You can perform unsigned comparisons of longs without using horribly inefficient BigIntegers. After testing a few ideas I came up with against some code by Tamutnefret of Freenode’s ##java, I found his code was fastest, so I’ve based the code … Continue reading

Posted in Java, Optimization | Leave a comment

How to compute 64-bit integer square roots very quickly

From an article section I’ve been working on for the past few days at code codex, The int version simply casts the result of StrictMath.sqrt to an int, giving us full hardware speed. The long version uses a trick by … Continue reading

Posted in Java, Optimization | Leave a comment