public class Fraction extends Object
Modifier and Type | Field and Description |
---|---|
int |
denominator |
int |
numerator |
Constructor and Description |
---|
Fraction(int numerator,
int denominator)
Creates a new
Fraction . |
Modifier and Type | Method and Description |
---|---|
int |
getDenominator()
Gets the denominator of the
Fraction |
int |
getNumerator()
Gets the numerator of the
Fraction |
double |
toDouble()
Returns the fraction as a floating point value (numerator divided by the denominator).
|
public Fraction(int numerator, int denominator)
Fraction
.numerator
- the numerator value.denominator
- the denominator value.public int getNumerator()
Fraction
public int getDenominator()
Fraction
public double toDouble()
double
, or Double.NaN
if the denominator is 0Copyright © 2021 gstreamer-java. All rights reserved.