negative numbers to hexdecimal
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
How can i transform a negative number like 0,2378 into hexdecimal? The function num2hex and dec2hex, they don´t work! and the bitcmp(..) also doesn´t work.
thanks for helping.
5 Kommentare
Samuel Gray
am 30 Dez. 2021
yeah, it works but what did you actually get...
hex notation is usually reserved for integers.
there is num2hex and dec2hex
the first will give you the 16-character representation,
the latter has a 2nd input that lets the user set the # of characters in the returned value
num2hex will work with both positive and negative reals.
Walter Roberson
am 30 Dez. 2021
Hex notation since at least the IBM 360 has been used to show the bits actually in memory, distinct from the interpretation that the bits are going to be given by the program and instructions. Instructions, characters, integers, floating-point numbers: hex to show you the real bits. Especially for those days when you suspect that the programming language or disassembler are treating a value incorrectly (which did happen...)
Antworten (0)
Siehe auch
Kategorien
Mehr zu Numeric Types finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!