2

Sign = 1 bit, Biased Exponent = 8 bits, Mantissa = 23 bits

What is the positive and negative possible range? My teacher told me the following range for ieee 754:

-0.5*2^-128 to -(1-2^-24)*2^127 (for negative floating point numbers)

0.5*2^-128 to (1-2^-24)*2^127 (for positive floating point numbers)

But I don't find this range correct because I am not able to understand how to store 0.5 * 2-128 into this format. Please explain.

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Manu Thakur
  • 345
  • 5
  • 11
  • According to [Wikipedia](https://en.wikipedia.org/wiki/IEEE_754-1985#Examples) those numbers are slightly off. It's also important to know if you're including denormalized values or not - I'm guessing normalized values only. If the mantissa did not include the hidden bit that's part of IEEE 754 that would make a difference as well. – Mark Ransom Aug 25 '15 at 02:47
  • Yes, normalized values only. Mantissa includes hidden value also, what will be the minimum positive or negative value that can be stored in ieee 754 single precision floating point format? – Manu Thakur Aug 25 '15 at 03:04

1 Answers1

4

Firstly, the floating-point number format is symmetric for positive and negative numbers. So we will only look at the positive case.

The maximum positive number has the maximum mantissa 1.111111111111111111111112 and maximum non-infinite exponent 127. Thus 1.111111111111111111111112 × 2127 = (2 − 2−23) × 2127 ≈ 3.402 × 1038 ≈ 2128.

The minimum positive number has the non-zero mantissa 0.000000000000000000000012 and the minimum exponent −126 for subnormal/denormalized numbers. Thus 0.000000000000000000000012 × 2−126 = 2−23 × 2−126 = 2−149 ≈ 1.401 × 10−45.

Further reading: https://en.wikipedia.org/wiki/Single-precision_floating-point_format

Nayuki
  • 17,911
  • 6
  • 53
  • 80
  • don't we need to normalized the mantissa, that should be in the form of 1.bbbbbbb... 23 times, where b can be either 0 or 1. – Manu Thakur Aug 25 '15 at 01:18
  • The mantissa does not need to be normalized. For the smallest exponent, the mantissa can have a leading "0." or "1.", and the choice is encoded in the exponent. See the Wikipedia entry for details. – Nayuki Aug 25 '15 at 04:07