Jim Starkey wrote:
Brian Aker wrote:
Hi!
On Feb 8, 2009, at 9:13 AM, Antony T Curtis wrote:
That was why I was surprised that an existing 'big integer' library
wasn't used when my_decimal first hit the tree.
There was at the time a big NIH going on around this.
Do you have a suggestion for a better one? I'd love to see someone go
through and replace this code and have us shift to sometime that makes
sense.
Well, there is the Falcon BigInt, but I guess that violates the
"innovation happens elsewhere" philosophy.
The Falcon BigInt is not quite complete. It has the big stuff --
including an arbitrary precision divide implemented by Chris Powers --
but is missing add and subtract. I'm doing those for Nimbus and will
give the code back to Falcon, so there wouldn't be any licensing
issues. It does have a nice serialization facility, though.
Falcon also has a class ScaledBinary to translate between the MySQL
bastard decimal format and BigInt.
So between the "here" of Falcon and the "elsewhere" of Nimbus, you
should have all the silliness bases covered.
Jim, I recognize Falcon/Nimbus has/all/mostly complete of these
ValueObject types. I'm very much interested in investigating how Falcon
does ValueObject stuff when we get there.
That said, Falcon BigInt and ScaledBinary is just as Not-Invented-Here
as MySQL's decimal type is. What we look for is *community-supported*
open source packages. The advantage to these packages is that there is
a much larger community which is responsible for maintaining and being
experts of the associated functionality.
While you and Chris Powers may be excellent coders/designers/architects,
I will always put my money in the larger community to punt this kind of
thing to. It just makes more strategic sense.
So, therefore, personally, I am more interested in learning from the
design problems Falcon/Nimbus has solved in the ValueObject architecture
than the underlying low-level mathematical calculations your code may
have solved.
Hope this makes sense.
Jay
But as I have mentioned before, dropping into arbitrary precision binary
to handle currency is really foolish. A 64 bit int can hold a lot of
dollars and cents and is a hell of a lot faster than arbitrary precision
binary. It does, however, require a mastery of 7th grade mathematics to
work out the conversions.
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp