Ack....I got caught by the floating point vs integer division....
I was doing division, but forgot to typecast to double so that I didn't get truncation:
numTime = (int)Math.ceil((double)(x.length - patchSize[p][0]) / displacement[0]) + 1;
I was doing division, but forgot to typecast to double so that I didn't get truncation:
numTime = (int)Math.ceil((double)(x.length - patchSize[p][0]) / displacement[0]) + 1;
0 Comments:
Post a Comment