15.5k views
2 votes
In MATLAB we have that realmin =2.2251e−308, realmax =1.7977e+308, and eps =2.2204e−016.

If a floating point number x is greater than realmax, then it is assigned the value Inf to indicate an overflow.
If x<− realmax, then it is assigned the value −Inf.
Please write down the result of the following computations if they were performed in MATLAB and write a brief explanation of why your answer is correct:
a) >>y =realmax+realmin

1 Answer

2 votes

Final answer:

The result of the computation y = realmax+realmin in MATLAB would be Inf.

Step-by-step explanation:

The result of the computation y = realmax+realmin in MATLAB would be Inf.

In MATLAB, if a floating point number x is greater than realmax (1.7977e+308), it is assigned the value Inf to indicate an overflow. Since realmax+realmin would be greater than realmax, the result will be Inf.

This is because realmin (2.2251e-308) is too small to affect the value of realmax, so adding them together will still result in Inf.

User Haste
by
7.6k points