Course of Raku / Essentials / More about types / Data type conversion / Exercises
Fractional part
Problem
You are given a number, which is hard-coded in the program. Print its fractional part. Here is the beginning of the program:
my $n = 15.8972;
# ... Your code hereExample
The program must print the part of the number after the decimal point:
$ raku fractional-part.raku
0.8972Solution
Course navigation
← Solution: True and False strings | Solution: Fractional part →
Translations of this page: English • Deutsch • Español • Italiano • Latviešu • Nederlands • Български • Русский • Українська