How do I get the only the integer part?

I want to get the 1846,but I get the 1845.Why is that?
Is there any other good way?
a=1.8460e+03;
a1=fix(a);
>>
1845

 채택된 답변

KSSV
KSSV 2022년 10월 11일

0 개 추천

a=1.8460e+03;
round(a)
ans = 1846

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

zl
2022년 10월 11일

댓글:

zl
2022년 10월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by