Quote (mcfighter @ Sep 12 2012 07:29pm)
Thank you, not sure by what system you mean?
We are using C, and Linux if that helps.
What's the decimal equivalent of the largest unsigned binary integer that can be represented using 'n' bits?
I meant standard, not system sorry.
What does each digit represent? Unlike integers, there is no straightforward logical way to handle it afaik. If you have n bits, are the first x going to be the integer portion and the last n-x going to be the decimal portion? are all n bits going to be the decimal portion? is the first x digits going to be the base (assuming leading 1) and last n - x digits going to be an exponent? etc etc
iirc C does not have an unsigned floating point out of the box. their float is system dependent, though usually IEEE which is signed. you could, of course, follow IEEE's format then treat the sign bit as an additional base or exponent digit. i could be wrong but i dont think IEEE has a standard for any generic n bits, but rather very specific numbers of bits (eg 32, 64, and 128 are defined, but 37 bits is not defined)
do you handle infinity and NotANumber?
bottom line, you have to ask your teacher how he wants you to write your unsigned floating numbers.
This post was edited by carteblanche on Sep 12 2012 05:49pm