negative numbers to hexdecimal
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Samuel Gray
el 30 de Dic. de 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
el 30 de Dic. de 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...)
Respuestas (0)
Ver también
Categorías
Más información sobre Numeric Types en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!