Yes, known since Palm OS 2.0. Floating point is emulated so rounding errors are common. One suggestion is to figure out the accuracy you require and add the appropriate rounding correction for each calculation. i.e. you require accuracy to 3 decimal places. Add 0.00005 to function results to correct and drop decimal places below the required 3. 64.554999999999 + 0.00005 = 64.555049999 and drop the '049999' from the result.
Search this forum's archives for other suggestions made in the past. ----- Original Message ----- From: "Enrico Pavesi" <[EMAIL PROTECTED]> Newsgroups: palm-dev-forum To: "Palm Developer Forum" <[EMAIL PROTECTED]> Sent: Friday, January 24, 2003 10:33 AM Subject: Codewarrior 8 Palm Problem in double multiplication !? > There is a problem in float operation on Codewarrior 8.3 Palm. > > RigaOrdine.importo =(dTemp * RigaOrdine.qta) > > Where > double dTemp = 12.91100000000000 > double RigaOrdine.qta=5.000000000000000 > > Gives 64.55499999999999 > INSTEAD OF 64.55500000000000 > > Is this a known problem? > > Is there any workaround? > > Thanks > > > > > -- > For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
