Logo

Programming-Idioms

History of Idiom 142 > diff from v20 to v21

Edit summary for version 21 by gattilorenz:
New Perl implementation by user [gattilorenz]

Version 20

2019-09-26, 13:55:30

Version 21

2019-09-26, 14:29:43

Idiom #142 Hexadecimal digits of an integer

Assign to string s the hexadecimal representation (base 16) of integer x.

E.g. 999 -> "3e7"

Idiom #142 Hexadecimal digits of an integer

Assign to string s the hexadecimal representation (base 16) of integer x.

E.g. 999 -> "3e7"

Extra Keywords
hex hexa radix
Extra Keywords
hex hexa radix
Code
my $s = sprintf("%x", $i);