num2str(1234567890123456789) returns '1234567890123456768'
Show older comments
Please help: command num2str(1234567890123456789) on matlab returns '1234567890123456768'...seems to be some overflow error, as last two digits have got changes from 89 to 68.
Answers (1)
Jan
on 18 Mar 2017
0 votes
Exactly. Matlab stores the values in the IEEE754 format, which use about 16 digits. This is the standard format for floating point numbers, such that this is not a problem of Matlab but a general decision for numerical software.
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!