Logo

Programming-Idioms

History of Idiom 142 > diff from v7 to v8

Edit summary for version 8 by steenslag:
New Ruby implementation by user [steenslag]

Version 7

2016-08-14, 20:20:11

Version 8

2016-08-22, 19:56:29

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
Extra Keywords
hex hexa
Code
s = 999.to_s(16)  # => "3e7"