Raku-Kurs / Grundlagen / Mehr über Typen / Datentyp-Konvertierung

Quiz: Was ist sein Typ?

Wählen Sie den richtigen Typ für jedes der aufgelisteten Literale aus.

Str"Hello, World!" ist (: Int, Rat, Num, Str :)
Str'Hello, World!' ist (: Int, Rat, Num, Str :)
Int12345 ist (: Int, Rat, Num, Str :)
Str'12345' ist (: Int, Rat, Num, Str :)
Rat123.45 ist (: Int, Rat, Num, Str :)Dies ist eine rationale Zahl in Raku, keine Gleitkommazahl.
Rat500.000 ist (: Int, Rat, Num, Str :)Auch wenn die Zahl keinen tatsächlichen Dezimalteil hat, ist ihr Typ nicht Int.
Int500_000 ist (: Int, Rat, Num, Str :)_ ist ein Tausendertrennzeichen zur einfacheren Lesbarkeit für Menschen.
Str'3.14e2' ist (: Int, Rat, Num, Str :)Dies ist eine zitierte Zeichenfolge, also ist es ein String.
Rat3.14 ist (: Int, Rat, Num, Str :)
Num3.14e0 ist (: Int, Rat, Num, Str :)

Kursnavigation

Lösung: Bruchteile   |   Typisierte Variablen