List of usage examples for org.apache.commons.math3.fraction Fraction ZERO
Fraction ZERO
To view the source code for org.apache.commons.math3.fraction Fraction ZERO.
Click Source Link
From source file:org.libreplan.business.common.ProportionalDistributor.java
private static Fraction[] toFractions(int initialTotal, int... shares) { Fraction[] result = new Fraction[shares.length]; for (int i = 0; i < result.length; i++) { result[i] = initialTotal == 0 ? Fraction.ZERO : new Fraction(shares[i], initialTotal); }//from ww w .j a va 2 s . c o m return result; }