Write a Matlab program by using a while loop that finds the smallest positive number 2^m such that 1+x>1 in the machine.

1 次查看(过去 30 天)
m must be a negative integer. Technically from the way that my professor phrased it, shouldn't m be -infinity?
  2 个评论
James Tursa
James Tursa 2018-8-14
编辑:James Tursa 2018-8-14
"... shouldn't m be -infinity?"
2^(-infinity) = 0, and 1+0 is not greater than 1. So, no, the way the professor phrased it, -infinity is not the answer.
Do as the professor instructed and write some code with a while loop to figure out the answer.

请先登录,再进行评论。

回答(1 个)

Vishal Chaudhary
Vishal Chaudhary 2018-8-17
编辑:Vishal Chaudhary 2018-8-17
Precision differs in MATLAB and theoretical calculation. So when you write while loop you will know the difference.

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by