On 8 Feb 2009, at 04:30, Jim Starkey wrote:

Konstantin Osipov wrote:
* Jim Starkey <[email protected]> [09/01/16 08:01]:

A more intelligent, denser, faster, and more intuitive format would use a single vector of binary words. On a challenge from Monty (W.), I did a relative performance measure between the Falcon decimal type and the "server" type. The worst case (> 18 decimal digits of precision) showed Falcon 40% faster. For anything less than 18 decimal digits of precision, Falcon was approximately infinitely faster (Falcon uses a 64 bit int with a decimal scale factor).


There is no precise conversion from base 2/4/8/16 representation to base 5/10 representation when you have digits after the (decimal, binary) point.
That's why base 2 representation just can't be used.


You better give an example. Good luck. I think you will find that 123.45 can be represented as 12,345 with a decimal scale of 2.

I'd have to agree with Jim here. I think you're confusing how floating point is traditionally represented and looking at the problem as simply " x * 10^(-y) ". The problems of storing and manipulating large integers has already been solved, only need to implement the other bit.

That was why I was surprised that an existing 'big integer' library wasn't used when my_decimal first hit the tree. I wasn't able to argue for the removal of my_decimal (other than the fact that I didn't like it) because I didn't have the data on hand and *anything* would have been better than the decimal implementation which was there before it.

As a semi-random side note... A 32bit Pascal compiler I used from the 1990's had a "Currency" type which was represented by a 63 bit signed number which had a fixed decimal precision 10^-4. Fast, simple, accurate, effective and completely transparent to the programmer. I liked it and since then, I have implemented similar things whenever I manipulate currency for my own projects.

Regards,
Antony.

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to