Integer Square Root

Don nospam at nospam.com
Thu Aug 12 12:01:19 PDT 2010


Mike James wrote:
> Would it be more useful to have a true integer square root rather than 
> overloading the real square root? 

cast(int)sqrt() is MUCH quicker than any other way of doing it. Note 
that overloading sqrt is a temporary hack.
BTW, your code fails for intsqrt(0x8000 * 0x8000) and higher.



More information about the Digitalmars-d mailing list