|
IEEE-754 converter +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (https://www.hpmuseum.org/forum/forum-10.html) +--- Forum: HP Prime Software Library (https://www.hpmuseum.org/forum/forum-15.html) +--- Thread: IEEE-754 converter (/thread-24122.html) |
IEEE-754 converter - Joaocaminha - 2025-10-03 10:50 IEEE754 converter v3 Today, the most prevalent representation of real numbers on computers is IEEE Standard 754 floating point. This progrm converts floats to hexadecimal or vice versa using the IEEE-754 standard introduced in SSE instructions set. Syntax: IEEE754(a, b) "a" can be a decimal, hexadecimal or a string. Hexadecimals are case-sensitive and must be uppercase. Strings must be used to convert decimals with more than 12 digits. In CAS mode strings must be used when convert from hexadecimals to floats e.g. IEEE754 ("#123h",16). In CAS mode when convert from floats to hexadecimals, the result will be a string. "b" can only be : 0 - Display this help 8, 16, 32 or 64 - bits base conversion If bases are negative the result will show a string with more digits. Examples: IEEE754 (3.14159265359, 64) → #400921FB54442EEAh; IEEE754 (#400921FB54442EEAh, 64) → 3.14159265359; IEEE754 ("3.141592653589793", 64) → #400921FB54442D18h; IEEE754 (#400921FB54442D18h, -64) → "3.14159265358979311599796346854" In CAS mode: IEEE754 ("#6Dh",8) → 14.5 IEEE754 (14.5, 8) → "#6Dh" ![]() If you find any error, please report in this thread or to joaocaminha968@gmail.com Thank you. v1.Release. v2,v3 Corrections. |