I really don't think this is a precision issue, the answer should be around 0.226. Here is the exact code:
val = I(i,j) bucketSize pos = val / bucketSize
I is just the matrix from which I take values. Here is the result of MATLAB:
val = 29 bucketSize = 128 pos = 0
What am I missing?
matlab division integer-division
jakev
source share