Using int64 on a lower bit data class

1 visualización (últimos 30 días)
James Best
James Best el 5 de Dic. de 2018
Comentada: James Best el 5 de Dic. de 2018
Using int64 to convert from a 32-bit to int64 data class, essentially adding 0 bytes to extend the class.
Apart from extra space being used, are there any other negatives to doing this? I would assume no resolution is lost as all the original data is still stored in the int64 class.

Respuesta aceptada

Walter Roberson
Walter Roberson el 5 de Dic. de 2018
int64() of int32 data just sign extends
int64() of uint32 data just zero extends
uint64() of int32 data would result in 0 for any negative data because of saturation
uint64 of uint32 data would just 0 extend.
  1 comentario
James Best
James Best el 5 de Dic. de 2018
Thanks for your help, this makes a lot more sense now.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Productos


Versión

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by