Question

Je dois imprimer le résultat d'un programme de 20 chiffres significatifs, mais je ne sais pas comment imprimer plus de 15 chiffres (format long). Y at-il moyen d'y parvenir?

Était-ce utile?

La solution

Vous pouvez contrôler le format de votre sortie avec printf , tout comme en C, en suivant cette syntaxe avec ces < a href = "http://www.network-theory.co.uk/docs/octave3/octave_143.html" rel = "nofollow"> Format spécificateurs:

> printf('%.20f\n', pi)
3.14159265358979311600
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top