uint64

Unexpected uint64 behaviour 0xFFFF'FFFF'FFFF'FFFF – 1 = 0?

Unexpected uint64 behaviour 0xFFFF'FFFF'FFFF'FFFF – 1 = 0? Question: Consider the following brief numpy session showcasing uint64 data type import numpy as np a = np.zeros(1,np.uint64) a # array([0], dtype=uint64) a[0] -= 1 a # array([18446744073709551615], dtype=uint64) # this is 0xffff ffff ffff ffff, as expected a[0] -= 1 a # array([0], dtype=uint64) # what …

Total answers: 4