sqrt(2) must go

Simen Kjaeraas simen.kjaras at gmail.com
Thu Oct 20 07:28:25 PDT 2011


On Thu, 20 Oct 2011 15:54:48 +0200, Manu <turkeyman at gmail.com> wrote:

> I could only support 2 if it chooses 'float', the highest performance
> version on all architectures AND actually available on all architectures;
> given this is meant to be a systems programming language, and supporting  
> as
> many architectures as possible?

D specifically supports double (as a 64-bit float), regardless of the
actual hardware. Also, the D way is to make the correct way simple, the
fast way possible. This is clearly in favor of not using float, which
*would* lead to precision loss.

As for double vs real, a 32-bit int neatly fits in any double, making it
good enough. short and byte should convert to float, and I'm not sure
about long/ulong, since real may not have enough bits to accurately
represent it.

-- 
   Simen


More information about the Digitalmars-d mailing list