At 02:04 PM 9/3/2002 -0400, you wrote: >Can anyone explain why Value = 52 instead of 53? > > > float fValue = .53; > Int16 Value = (Int16)(fValue * (float)100); > >thanks
0.53 can't be exactly represented in binary... its actually more like 0.52999999... Multiplying this by 100.0 (a better way to force it to be floating point), gets you 52.99999... which is truncated down to 52. -- Ben Combee <[EMAIL PROTECTED]> CodeWarrior for Palm OS technical lead Palm OS programming help @ www.palmoswerks.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
