num2hex

num2hex(f)

Get a hexadecimal string of the binary representation of a floating point number

Examples

julia> num2hex(3.14159)
"0x1.921f9f01b866ep1"
julia> num2hex(-0.5)
"-0x1.0000000000000p-1"
julia> num2hex(10.0)
"0x1.4000000000000p3"

Common mistake example:

julia> num2hex("3.14")
ERROR: MethodError: no method matching num2hex(::String)

In this example, the function num2hex is expecting a floating point number as input, but a string is provided instead. Make sure to pass a valid floating point number to the num2hex function.

See Also

ascii, base64decode, Base64DecodePipe, base64encode, Base64EncodePipe, bin, bits, bytestring, charwidth, chomp, chop, chr2ind, contains, endswith, escape_string, graphemes, ind2chr, iscntrl, istext, isupper, isvalid, join, lcfirst, lowercase, lpad, lstrip, normalize_string, num2hex, parseip, randstring, readuntil, replace, repr, rpad, rsplit, rstrip, search, searchindex, split, startswith, string, stringmime, strip, strwidth, summary, takebuf_string, ucfirst, unescape_string, uppercase, utf16, utf32, utf8, wstring,

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field
Details

Checking you are not a robot: