This is an extremely basic question and I have to be missing something, but when trying to normalize matrix A below so that rows sum to one, some (small) differences remain:
A = rand(100,4)
A = A./sum(A, dims = 2)
sum(sum(A, dims =2) .== 1) # fewer than 100!
Why does this happen? Is there a way to solve this?