## realmax + 1 infinity?

### veloamoureuse (view profile)

on 11 Apr 2019
Latest activity Commented on by Jan

on 11 Apr 2019

### Stephen Cobeldick (view profile)

Hello!
How come is realmax + 1 not inifity when typed into command window?
Thank you.

### Stephen Cobeldick (view profile)

on 11 Apr 2019
Edited by Stephen Cobeldick

### Stephen Cobeldick (view profile)

on 11 Apr 2019

Because the value 1 is nowhere near the smallest value that can be added to realmax to create a new value. You would need to add a value that is more than half the difference between representable values around the magnitude of realmax. To get that value try using eps:
>> val = eps(realmax) % much bigger than 1.
val = 1.9958e+292
>> realmax + val/2
ans = Inf
>> realmax + val/3
ans = 1.7977e+308
This is exactly the same as if you add 1e-300 to 10: the answer is 10, because 1e-300 is nowhere near the difference in representable values around the magnitude 10, so adding 1e-300 makes absolutely no difference to the 10.

Jan

### Jan (view profile)

on 11 Apr 2019
Thanks Stephen, I've overseen teh "not" in the question.