Course of Raku / 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.5
Solution
Next exercise
Course navigation
← Associative data types / Interpolating hashes | More about functions →
Translations of this page: English • Deutsch • Español • Italiano • Latviešu • Nederlands • Български • Русский • Українська