Using int64 on a lower bit data class

조회 수: 3 (최근 30일)
James Best
James Best 2018년 12월 5일
댓글: James Best 2018년 12월 5일
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.

채택된 답변

Walter Roberson
Walter Roberson 2018년 12월 5일
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
James Best
James Best 2018년 12월 5일
Thanks for your help, this makes a lot more sense now.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by