How do I get the only the integer part?

57 views (last 30 days)
zl
zl on 11 Oct 2022
Commented: zl on 11 Oct 2022
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

Accepted Answer

KSSV
KSSV on 11 Oct 2022
a=1.8460e+03;
round(a)
ans = 1846

More Answers (0)

Categories

Find more on Graph and Network Algorithms 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!