开发者

Is there any way to print at least 20 significant figures in Octave?

开发者 https://www.devze.com 2023-01-23 21:14 出处:网络
I need to print the result of a program with 20 significant figures, but I don\'t know how to print more than 15开发者_高级运维 figures (format long). Is there any way to achieve this?You can control

I need to print the result of a program with 20 significant figures, but I don't know how to print more than 15开发者_高级运维 figures (format long). Is there any way to achieve this?


You can control the format of your output with printf, just like in C, by following this syntax with these format specifiers:

> printf('%.20f\n', pi)
3.14159265358979311600
0

精彩评论

暂无评论...
验证码 换一张
取 消