Dear All,

I am using the the latest version of Microchip's AN575. I found a =
rounding error in file FP24.A16, subroutine INT24 when FPFLAGS,RND is =
set.

Decimal     24bit Float    INT24 result    Decimal result
9.4999      8217FF        0009              9
9.50          821800         000A             10
9.9999       821FFF        000A             10       =20
10.4999     8227FF        000A              10
10.50        822800         000A              10        (should be 10 =
because it is equidistant from 10 and 11 so rounds to the number with =
bit 0 0)
10.999      822FFF        000A               10        (should be 11 !)
11.000      823000         000B              11
11.4999    8237FF        000B              11
11.50        823800         000C              12        (should be 12 =
because it is equidistant from 11 and 12 so rounds to the number with =
bit 0 0)
11.999      823FFF        000C              12       =20
12.0         824000         000C              12
12.4999    8247FF         000C              12
12.50       824800          000C              12
12.9999    824FFF         000C              12       (should be 13 !)
13.0          825000         000D              13  etc

Has anyone else who has noticed this error fixed it or know where I can =
get a working version ?=20
I contacted Microchip and they could not help me. I am using this =
version :
FP24.A16        07/10/96 07:50
(RCS Header $Id: fp24.a16 2.7 1996/10/07 13:50:29 F.J.Testa Exp $)



James Hillman

--
http://www.piclist.com hint: To leave the PICList
mailto:piclist-unsubscribe-request@mitvma.mit.edu