If you want to print a nmuber in hexadecimal though, just ise format/2:
0-padded 4 nibbles:
?- Code=6464, format(atom(T),"0x~|~`0t~16r~4+",[Code]). Code = 6464, T = '0x1940'.
Did you know ... | Search Documentation: |
Predicate hex_bytes/2 |
Example:
?- hex_bytes('501ACE', Bs). Bs = [80, 26, 206].
If you want to print a nmuber in hexadecimal though, just ise format/2:
0-padded 4 nibbles:
?- Code=6464, format(atom(T),"0x~|~`0t~16r~4+",[Code]). Code = 6464, T = '0x1940'.