PDA

View Full Version : [RubyForge] LongDecimal for numbers with fixed point:LongDecimal pre-alpha-0.09


ruby-lang
March 9th, 2006, 01:35 AM
This version of LongDecimal contains the functionality of the previous version with some minor cleanups.

It has shown that Complex and BigDecimal do not go together as well as they could, so in conjunction with complex operations LongDecimals convert themselves into floats, possibly overflowing. This should not hurt too much because the intended purposes of LongDecimal suggest that they should not heavily occur in conjunction with Complex, but off course putting them together should work in a meaningful way (least surprise principle).

Some tests have been added and comments have been added.

An exponential function for longdecimal has been added. It needs to be proved that it always produces the significant digits it claims correctly, but tests have shown some evidence that this is not too far from the truth. The algorithm for calculating exp is somewhat optimized for speed, but analyzing the algorithm will allow to verify more accurately the number of digits needed for internal calculations and thus allow some further optimizations. Any information about way better algorithms are welcome.

We still lack logarithms and off course some tests, bug fixing and commenting until this can become alpha.

Support for GEM is still experimental.

Any feedback welcome!

<a href="http://rubyforge.org/forum/forum.php?forum_id=5906" target="_blank">http://rubyforge.org/forum/forum.php?forum_id=5906</a>