Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[imp-dev] BigInteger and BigDecimal for pdb.values

Hi!

We're using PDB.values a lot, and I've been able to spend time to 'get it right'. However, there
seems to be one big But.

The PDB integers and doubles are now limited to java Integer and Double, which is not right for the kind
of functionality that PDB offers. The users of the PDB API should not have to worry about overflow and
precision. It's the kind of API that offers abstraction from such details. Also, for the Rascal language which
is built on top of PDB we want to provide a similar abstraction.

So, I propose to change the semantics of pdb integers and doubles to BigInteger and BigDecimal. Also,
it may be prudent to change the name 'double' to 'decimal' in this respect.

We will pay in terms of efficiency initially, since I intend to simple implement these BigIntegers and BigDecimals
using the Java standard library. However, future optimized implementations of the IValue interfaces can try to
fit numbers in normal ints (like other open-source Big Integer implementations sometimes do).

Cheers,

Jurgen


Back to the top