Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

how to efficiently storing floating point numbers with limited number
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?

Report this thread to moderator Post Follow-up to this message
Old Post
moogie
04-01-08 08:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Compression archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:16 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.