Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要打印一个包含 20 个有效数字的程序的结果,但我不知道如何打印超过 15 个数字(格式长)。有什么办法可以做到这一点?
printf就像在 C 中一样,您可以使用以下格式说明符来控制输出格式:
printf
> printf('%.20f\n', pi) 3.14159265358979311600