matlab digit precision is not correct?

Quoting from:
By default, MATLAB® uses 16 digits of precision.
But why when I write 900000000+2 (8 zeros after 9) it returns 900000002 but writing 900000000+2 (9 zeros after 9)returns 9.0000e+09 isn't this an 8 digit precision?

답변 (1개)

James Tursa
James Tursa 2020년 4월 7일
편집: James Tursa 2020년 4월 7일

0 개 추천

That is just a display artifact. The entire number is still there in memory. Do this to change the display format
format longg
and then repeat your test.

카테고리

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

태그

질문:

2020년 4월 7일

댓글:

2020년 4월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by