Course of Raku / Essentials / Variables and data types essentials / Numbers / Exercises / The value of π
Solution: The value of π
The program to print the value of π is simple enough.
Code
say π;🦋 You can find the full code in the file pi.raku.
Output
Run the program and see what it prints:
$ raku exercises/numbers/pi.raku
3.141592653589793Comments
Raku offers us a built-in constant called π, which makes
the program trivial. Nevertheless, consider other options for doing the
same:
π.say;Or:
pi.say;Or:
say pi;Course navigation
← The value of π | The last digit →
Translations of this page: English • Deutsch • Español • Italiano • Latviešu • Nederlands • Български • Русский • Українська