- #1

denian

- 160

- 0

the answer should be NaN instead of infinity rite?

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

- Thread starter denian
- Start date

- #1

denian

- 160

- 0

the answer should be NaN instead of infinity rite?

- #2

HallsofIvy

Science Advisor

Homework Helper

- 43,021

- 971

(Although now, I'm going to waste time pondering what an "infinity rite" could be!)

- #3

denian

- 160

- 0

from your statement, i conclude that the exact answer should be infinity.

am i right?

what if, i have this floating point number : 11111111100000000000000000000000

and i am to convert this floating point number to decimal, the answer should be infinity, isn't it?

then can i summarise that if the exponential is all 1's, it will be infinity when converted to decimal?

thank you.

- #4

RiBBiT

- 1

- 0

denian said:

from your statement, i conclude that the exact answer should be infinity.

am i right?

what if, i have this floating point number : 11111111100000000000000000000000

and i am to convert this floating point number to decimal, the answer should be infinity, isn't it?

then can i summarise that if the exponential is all 1's, it will be infinity when converted to decimal?

thank you.

Whether you convert it to decimal or not does not really matter. In the standard floating point systems (IEEE SP and IEEE DP) there are two special cases for representing Inf and NaN. I believe (though I'm not sure) that both of these have an exponent with only 1's. Which of the cases it is should then be decided by the value of the mantissa.

- #5

denian

- 160

- 0

# Infinity is encoded when the exponent field is all 1’s and the mantissa is all 0’s.

# If the exponent contains all 1’s but the mantissa does not contain all 0’s, then this is referred to as NaN or Not a Number.

Share:

- Replies
- 19

- Views
- 612

- Replies
- 2

- Views
- 316

- Replies
- 13

- Views
- 620

- Last Post

- Replies
- 7

- Views
- 712

- Last Post

- Replies
- 18

- Views
- 384

- Last Post

- Replies
- 16

- Views
- 543

- Last Post

- Replies
- 2

- Views
- 273

- Last Post

- Replies
- 4

- Views
- 280

- Last Post

- Replies
- 2

- Views
- 523

- Replies
- 10

- Views
- 487