Code Comments
Programming Forum and web based access to our favorite programming groups.I want to store a set of floating points which have a maximum of 8 digits, sign and decimal point. i.e values between -99999999.0 and 99999999.0 e.g. these would be valid: -78.2234 6733.2225 these would be invalid and will need to be truncated: 224155.33366 tunc to 224155.33 -52.436627882 tunc to -52.436629 My current scheme will only save a few bytes: write sign (1 bit) write decimal point position (3bit) write digits (variable: 24 - 32 bits) digits 0-6 = 3 bits, digits 7-9 = 4 bits so a number would be repsented by between 28 and 36 bits which is very similar to that of a normal 32bit float... I may be able to get away with only needing six digit values, however that will only bring the number of bits needed to between 22 and 28bits which is not a significant saving. Anyone have any idea of a better way to store such values? is there a 16 bit or 24 bit floating point scheme?
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.