In between SmallIntegers and LargeIntegers...FloatIntegers?

Jon Hylands jon at huv.com
Thu Apr 18 22:39:40 UTC 2002


On Thu, 18 Apr 2002 13:38:52 -0400 (EDT), Jesse Welton
<jwelton at pacific.mps.ohio-state.edu> wrote:

> Unless this has changed recently, Squeak already uses floats for the
> integer arithmetic in its pseudorandom number generation.  When I
> played with this a couple of years ago, it was definitely much faster
> than using ints which overflowed into long ints.  Surprizingly, it was
> even faster than ints constrained to a short int range by arbitrarily
> reducing the modulus of the arithmetic.  I never fully understood why.

On machines with a floating point co-processor, its not really all that
surprising. The co-pro is significantly faster at math than the CPU.

As an aside, on the Pentium at least, floating point math can be done in
parallel, so for certain kinds of operations in certain kinds of
algorithms, the cost for the complex FP math is zero.

Later,
Jon

--------------------------------------------------------------
   Jon Hylands      Jon at huv.com      http://www.huv.com/jon

  Project: Micro Seeker (Micro Autonomous Underwater Vehicle)
           http://www.huv.com



More information about the Squeak-dev mailing list