hex#
Format a number as hexadecimal
Available in: math cells, REPL.
Syntax#
hex(value)
Arguments and behavior#
Returns a hexadecimal string including the 0x prefix, so hex(255) is 0xff. Use the Word size display setting to add a bit-width suffix when you want one.
Example#
Edit the inputs, then use Run or Reset. Changes stay in this example.
Example
hex(240)Interactive examples could not load. You can still copy the expressions.
Expected result: "0xf0".