Raku kurss / Pamati / Skaitļi / Veselie skaitļi

Tests: Unikode cipari un skaitļi

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

1 3  
1 12345  
1 This is considered a number, not a single digit.
0 ⓵⓶⓷⓸⓹ So you cannot combine them in such a way to get 12345.
1  
0 ❸❹❺  
1 A single Unicode character named CIRCLED NUMBER FOURTY TWO.
0 ⓸⓶ But the two numbers are not a number.
1 Circled Chinese 5 and it is a number CIRCLED IDEOGRAPH FIVE.
0 While 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.

Kursa navigācija

Skaitļi   |   Skaitļi / Racionālie skaitļi


💪 Or jump directly to the exercises to this section.

Šī lapa ir automātiski tulkota ar ChatGPT 4o. Oriģinālais teksts angļu valodā.

Šīs lapas tulkojumi: EnglishDeutschEspañolItalianoLatviešuNederlandsБългарскиРусскийУкраїнська