programming-examples/perl/Datatype/Convert decimal to hex.pl
2019-11-15 12:59:38 +01:00

11 lines
141 B
Raku

use integer;
$value = 257;
while($value) {
unshift @digits, (0 .. 9, a .. f)[$value & 15];
$value /= 16;
}
print @digits;