Course of Raku / Essentials / Functions essentials / Creating and calling functions / Exercises
Interval function
Problem
Create a program that implements a function according to this definition:

Print the result of the function for the arguments -2,
0, and 3.
Example
The program should print the following output:
$ raku interval-function.raku
2
0
2.5Solution
Course navigation
← Solution: Recursive factorial | Solution: Interval function →
Translations of this page: English • Deutsch • Español • Italiano • Latviešu • Nederlands • Български • Русский • Українська