I really don't think this is a precision problem, the answer should be about 0.226. Here's the exact code:
val = I(i,j)
bucketSize
pos = val / bucketSize
I
is just a matrix I'm taking values from. Here is the output from MATLAB:
val =
29
bucketSize =
128
pos =
0
What am I missing?