Search code examples
cfloating-pointieee

Largest positive finite IEEE number in terms of n and e?


Hi I'm doing homework for my computer science class and I'm stuck on this question.

Given a IEEE floating-point format of n bits with e exponent bits, give expressions for

  • a)The largest finite positive number.
  • b)The largest (closest to 0) negative number.
  • c)The minimum ULP.

in terms of n and e.

Could somebody help with these and explain why? Thank you so much


Solution

  • Floating point numbers can be expressed as

    (-1)^Sign * Number * 2 ^ Exponent
    

    And usually you have 23 bits for the number, 8 for the exponent and 1 for sign. With that you could answer 1) and 2). I don't know what ULP is.