From -360.0 to 360.0 in 0.01 steps gives 72001 values. 16 bits has 65536 values. If 0.02 steps is okay that gives 36001 values, and is within the 16 bit range. If 0.0 is binary 0x00 then 360.0 would be 18000 (0x4650) and -360.0 would be -18000 (0xb9b0). What are you going to do with these values? To display them would require a divide by 10. If they are just offloaded to something else that can convert to -360.0..360.0 then you could just pass them as is. David On Wed, 13 Mar 2002 12:53:49 +0100 Claudio Tagliola wrote: > Hi all, > > > I want to represent a certain value in as little 8-bit bytes as > possible. The value range is from -360.0 to 360.0, with 0.1 decimal > accuracy, maybe 0.01 if room permits. This (0.1 acc.) is possible in 16 > bits, but what representation would be best/most convenient? I'm > thinking about fixed point, but not shure (not my expertise). The > operations I would need most is simple addition, but gonio calculations > are needed too, albeit less used. PIC platform is the 16 family. Code > space is an issue, code execition speed is not (except when it's > 1 ms > per operation on a 40 Mhz PIC). > > > Best regards, > > Claudio > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads