danvim / ProcalParsing

0 stars 2 forks source link

Revamp the whole system by replacing BigDecimal with BigNumber which has a fraction implementation #22

Open danvim opened 7 years ago

danvim commented 7 years ago

Possible implementation

public class BigNumber{
    private int numerator;
    private int denominator;
    private BigDecimal decimal = new BigDecimal(numerator/denominator);
    private boolean state; //to be set when being constructed
    //... and whole bunch of other methods
}                        

Possible implementation

class BigNumber extends BigDecimal {
    //all your fraction stuff
    public BigNumber add(BigNumber bigNumber) {/*...*/}
}
mcreng commented 7 years ago

will help by adding .add(), .subtract(), .multiply(), .divide() and .pow() to BigFraction.

mcreng commented 7 years ago

will also add toImproperString(), toMixedString() and toString()

mcreng commented 7 years ago

the above-mentioned feature are added in commit https://github.com/danvim/ProcalParsing/commit/42445a320eeb38d7e235cfff12ab54b546bf4872.

mcreng commented 7 years ago

fixed .pow() method in commit https://github.com/danvim/ProcalParsing/commit/e78ed151c2b49333ea313f3651b589bc59f542fa.