How can I write a program that indicates a number if it is integer or not?
2 次查看(过去 30 天)
显示 更早的评论
How can I write a program that indicates a number if it is integer or not?
0 个评论
回答(3 个)
James Tursa
2018-3-15
doc floor
doc ceil
doc round
What happens if you use one of these functions and compare the result to the original value?
0 个评论
Roger Stafford
2018-3-15
编辑:Roger Stafford
2018-3-15
If n is your number, then
round(n)==n
is true if and only if n is an integer
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!