Example usage for org.apache.commons.lang.math Fraction TWO_THIRDS

List of usage examples for org.apache.commons.lang.math Fraction TWO_THIRDS

Introduction

In this page you can find the example usage for org.apache.commons.lang.math Fraction TWO_THIRDS.

Prototype

Fraction TWO_THIRDS

To view the source code for org.apache.commons.lang.math Fraction TWO_THIRDS.

Click Source Link

Document

Fraction representation of 2/3.

Usage

From source file:FractionExampleV1.java

public static void main(String args[]) {
    Fraction twoThirds = Fraction.TWO_THIRDS;
    Fraction fraction_whole = Fraction.getFraction(2, 2, 3);
    Fraction fraction = Fraction.getFraction(27, 98);
    Fraction fraction_double = Fraction.getFraction(4.56);
    Fraction fraction_string = Fraction.getFraction("2 1/3");

    System.err.println(twoThirds.doubleValue());
    System.err.println(fraction_string.getNumerator());
    System.err.println(fraction_whole.divideBy(fraction_double));
    System.err.println(fraction.divideBy(fraction));
}