Course of Raku / Advanced / More about built-in types / Native types 🆕 / Exercises
Wrapping around
Problem
A uint8 wraps around in both directions, and not only
when you step over the edge by one. Demonstrate this:
- Take a
uint8holding250, add10to it, and print the result. - Take another
uint8holding0, subtract one (decrement it), and print the result.
Example
The program prints:
4
255Solution
Course navigation
← Solution: The native default | Solution: Wrapping around →