Course of Raku / Essentials / Variables and data types essentials / Numbers / Integer numbers

Quiz: Unicode digits and numbers

Try to find out which of the following digits form integers that Raku accepts as the Int type values.

13
112345
1This is considered a number, not a single digit.
0⓵⓶⓷⓸⓹So you cannot combine them in such a way to get 12345.
1
0❸❹❺
1A single Unicode character named CIRCLED NUMBER FOURTY TWO.
0⓸⓶But the two numbers are not a number.
1Circled Chinese 5 and it is a number CIRCLED IDEOGRAPH FIVE.
0While this means 5, the character is neither a digit nor a number.
0一二三四五

Comments

You can take the following program as a starting point to play with and explore the properties of such digits. Uncomment the lines to see if that compiles.

my $x;
$x =  3;
say $x; say $x.WHAT;

$x =  12345;
$x =  ⓷;
# $x =  ⓵⓶⓷⓸⓹;

$x =  ❷;
# $x =  ❸❹❺;

$x =  ⒌;
# $x =  ⒊⒋⒌;

# $x =  ㊀㊁㊂㊃㊄;
$x =  ㊄;
say $x; say $x.WHAT;

# $x =  五;
# $x =  一二三四五;

$x = ㊷;
say $x;

🦋 Take the code from GitHub: unicode-digits.raku.

Course navigation

Quiz: Integer numbers   |   Rational numbers

Translations of this page: EnglishDeutschEspañolItalianoLatviešuNederlandsБългарскиРусскийУкраїнська