Logo

Programming-Idioms

History of Idiom 142 > diff from v8 to v9

Edit summary for version 9 by programming-idioms.org:
[Ruby] Integer variable is x

Version 8

2016-08-22, 19:56:29

Version 9

2016-08-22, 20:43:34

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"
Code
s = x.to_s(16)