half and quad

Olifant olifant at gmail.com
Thu Oct 11 12:42:28 PDT 2007


Unlike C++, D seems to be pretty consistent with basic numeric types, such as clearly defining the exact bitsize of integers ranging from 8 to 128 bits, and floating point numbers ranging from 32 and 64 bit.

However, what appears to be missing are half precision and quad precision floating point numbers. I know they're not really standard yet, but they will be soon (http://en.wikipedia.org/wiki/IEEE_754r). The range of exact bitsizes for floating point numbers in D could be extended from 16 to 128 bit.

The keyword "cent" is reserved for 128-bit integers. Could "half" and "quad" be reserved for respectively 16-bit and 128-bit floating point numbers?

If the 128-bit floating point numbers are standard, then it will be nice to have "quad" to cover those, instead of using the type "real" that doesn't really specify the size.

And "half" could be very useful in some algorithms such as those on GPU-like processors.

It would be quite dirty if D would after so many years when those things are standard, have to come up with some bad names for those types similar to how "wchar_t" in C++ is a bad name.



More information about the Digitalmars-d mailing list