How can num2str function cut off some digits in Matlab?

$\begingroup$

I am reading the book " MATLAB: A practical introductoin programming and problem solving", written by Stormy Attaway and getting curious with the function "num2str".

On page 256, the author used the following steps to convert a number into a string

str2 = num2str(3.456789)

str2=

3.4568

Why are the digits 7 and 9 obmitted? In general, how can we know what the obmitted digits are?

Thank you for your help.

$\endgroup$ 2 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like