Alex Rivera | Logout

Why no unsigned floating point types?

Asked 2010-08-28T06:01:24.263
23

Possible Duplicate:
Why doesn't C have unsigned floats?

The question is probably very basic and probably answered many time earlier, but I want to understand why C++ does not have unsigned floating point types, even though floating point literals can be signed or unsigned.

$3.9.1/8- "There are three floating point types: float, double, and long double."

Edit
Report

1 Answer

10

All floating points are signed. C++ follows the IEEE 754 standard, which is the most common hardware implementation and following it, floats are always signed.

As the floats already take up at least 32 bits, the gain of having a software implementation that would regain that 1 bit is insignificant compared to the usefullness of such an implementation.

answered 2010-08-28T06:06:01.273

Your Answer