How can I write a program that indicates a number if it is integer or not?
조회 수: 4(최근 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
참고 항목
범주
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!