BUG in dec2hex

1 vue (au cours des 30 derniers jours)
XX
XX le 4 Sep 2023
Modifié(e) : Stephen23 le 4 Sep 2023
  1 commentaire
Stephen23
Stephen23 le 4 Sep 2023
Modifié(e) : Stephen23 le 4 Sep 2023
You do not explain what the problem is.
Note that your last example uses DOUBLE class and not UINT64, which clearly has a different bit pattern:
u = bitxor(uint64(0xFF000000),0xFFFFFFFFFFFFFFFF)
u = uint64 18446744069431361535
dec2hex(u)
ans = 'FFFFFFFF00FFFFFF'
d = double(u) % The same value you entered by hand
d = 1.8447e+19
dec2hex(d)
ans = 'FFFFFFFF01000000'

Connectez-vous pour commenter.

Réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by