Example usage for org.apache.commons.math3.fraction Fraction ZERO

List of usage examples for org.apache.commons.math3.fraction Fraction ZERO

Introduction

In this page you can find the example usage for org.apache.commons.math3.fraction Fraction ZERO.

Prototype

Fraction ZERO

To view the source code for org.apache.commons.math3.fraction Fraction ZERO.

Click Source Link

Document

A fraction representing "0".

Usage

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;
}