MATLAB: What is the max value you can give to precision

precisionwhat is the max value

Hi, what is the max value you can give to precision for example
dlmwrite('Myfile.txt', data, 'delimiter', '\t','precision',100)
in place of 100 what is the max 1000 , 1000000 …. ? if you know this information, thank you to share it with me.

Best Answer

This talk of precision being 1e308 or 1e10 or whatever is utter nonsense.
edit: There was another answer, now deleted, that said that the max precision was 1e308, then more discussion where 1e10 was suggested.
The maximum magnitude of double precision numbers is around 1e308 (use realmax to get the real value), but that has absolutely nothing to do with the precision argument of dlmwrite (or sprintf, fprintf, compose and co.). The precision argument of these function tells matlab how many decimal digits to print.
The maximum value for that precision is deliberately not documented. It is dependent on your computer hardware, your operating system, and possibly the version of matlab. See the note in the formatspec section of the documentation of sprintf.
You should be fine with a precision of 16. Anything above that may or may not have an impact and anything vastly superior to that is meaningless.