BUG in dec2hex

2 次查看(过去 30 天)
XX
XX 2023-9-4
编辑: Stephen23 2023-9-4
  1 个评论
Stephen23
Stephen23 2023-9-4
编辑:Stephen23 2023-9-4
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'

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Numbers and Precision 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by