Continued Fraction

I've updated ContinuedFraction to use numerator a over denominator b. This is consistent with the original source paper for the method.


Fraction

While looking at the fraction package it was very hard to compare Fraction and BigFraction side-by-side. This is a problem as the two are essentially the same using a different internal representation.

I also did a big arrangement of Fraction and BigFraction. The two had diverged quite a bit in their internal method order and the javadoc. I have updated them to be consistent. They should be easily compared side-by-side and this will reduce maintenance burden when they are updated together.

I copied the method order from Complex with changes as appropriate:

    private constructors

    factory constructors, including parse(String)

    Properties:
    zero(), one()
    numerator(), denominator()

    Computed properties:
    signum

    Conversions:
    abs, negate, reciprocal
    primitive values (double/float/int/longValue,etc)

    Math:

    Arithmetic
    add,subtract,multiply,divide

    Power functions

    Standard object stuff:
    toString(), compareTo, equals(), hashCode()

I spotted a bug in the Fraction.of(double, ...) constructors where there was no validation of NaN or infinity so I have added this to Fraction and BigFraction to throw an IllegalArgumentException.

Alex



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to