History of Idiom 142 > diff from v2 to v3
Edit summary for version 3 by programming-idioms.org:
New Go implementation by user [programming-idioms.org]
New Go implementation by user [programming-idioms.org]
↷
Version 2
2016-08-14, 16:24:22
Version 3
2016-08-14, 16:29:47
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"
Comments bubble
This works because *big.Int implements the fmt.Formatter interface.
%x is the "verb" for base 16. Not to be confused with the variable name x.