Compiler optimizations
Walter Bright
newshound at digitalmars.com
Tue May 2 02:05:57 PDT 2006
Craig Black wrote:
> This is
> because integer division is essentially floating point division under the
> hood.
Not exactly. What is true is that both kinds of division are based on
the same 'shift and subtract' method (the same algorithm taught in 3rd
grade for doing long division). If you're really interested in exactly
how integer and floating point division work, get the Digital Mars CD
which has complete source code to an IEEE 754 floating point emulator,
as well as code to do integer division for long's.
www.digitalmars.com/shop.html
More information about the Digitalmars-d
mailing list