Question by Sri Mahesh Burukule :
Why there is no unsigned float defind in C ?
unsigned is a restricted data type useful only for integers ( int short and long ). Regular int’s can be used very well for positive only numbers but the range would be just half since the negative representations are not used. Using unsigned makes it possible to use entire range as positive numbers. float already has a huge range ( 2 to the power 127 OR 10 to to power 40 approx. ). There is no need to extend the range to use only positive fractional numbers. We might as well used the signed representation for positive only fractional numbers too.
Please login first to submit.