Cursus Raku / Elementa / Typis variabiles / Typus limitationes

Quiz — Typus limitationes

Make the variables in the below program typed-restricted. Choose the most narrow type required to keep the value;

Int my ␣␣␣ $a = 500;  
Int my ␣␣␣ $b = 304839573985398539853535353; Long numbers are supported out of the box.
Rat my ␣␣␣ $c = 3.5; This is a Rat. Note that Num values are written in scientific notation.
Rat my ␣␣␣ $d = 17/19; This is also a Rat, and not a division.
Rat my ␣␣␣ $e = <2/5>; This is one of the possible notations for Rats.
Num my ␣␣␣ $f = pi; The built-in value of π is a Num value.
Num my ␣␣␣ $g = 3e-4;  
Str my ␣␣␣ $h = ‘18’;  

Cursus navigatio

Typis variabiles   |   Typis variabiles / Utendo of


💪 Or jump directly to the exercises to this section.

Haec pagina automatice translata est per ChatGPT 4o. Originalis Anglicus textus

Translationes huius paginae: EnglishDeutschEspañolItalianoLatviešuNederlandsБългарскиРусскийУкраїнська