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!