Vincent Cheung

Vincent Cheung's Blog


« Newer Post Home Older Post »

Wednesday, May 19, 2004

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;

0 Comments:

Post a Comment