For Programmers: Free Programming Magazines  


Home > Archive > Compression > April 2008 > Re: how to efficiently storing floating point numbers with limited









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: how to efficiently storing floating point numbers with limited
Hans-Peter Diettrich

2008-04-01, 7:56 am

moogie wrote:

> 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


Some compilers have an data type Currency, which is a scaled integer
(fixed point, e.g. 64 bits, divided by 10000). Such types are designed
for somewhat lossless representation of floating point values, and fast
calculations, not for compression.

You seem to mean kind of BCD representation, based on decimal digits,
what's not a widely supported data type. A conversion between the usual
binary floating point values (base 2) and BCD (base 10) can result in
unwanted loss of precision.

DoDi
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com