public class Fraction extends java.lang.Object implements TexElement
| Constructor and Description |
|---|
Fraction(int n) |
Fraction(int numerator,
int denominator) |
| Modifier and Type | Method and Description |
|---|---|
Fraction |
abs() |
Fraction |
div(Fraction other) |
Fraction |
div(Fraction other,
boolean reduce) |
Fraction |
div(int other) |
Fraction |
div(int other,
boolean reduce) |
boolean |
equals(java.lang.Object obj) |
int |
getDenominator() |
int |
getNumerator() |
Fraction |
minus(Fraction other) |
Fraction |
minus(Fraction other,
boolean reduce) |
Fraction |
minus(int other) |
Fraction |
minus(int other,
boolean reduce) |
Fraction |
plus(Fraction other) |
Fraction |
plus(Fraction other,
boolean reduce) |
Fraction |
plus(int other) |
Fraction |
plus(int other,
boolean reduce) |
Fraction |
pow(int n) |
Fraction |
pow(int n,
boolean reduce) |
Fraction |
reciprocal() |
Fraction |
reduce() |
protected Fraction |
sqrt() |
boolean |
sqrtIsRational() |
Fraction |
times(Fraction other) |
Fraction |
times(Fraction other,
boolean reduce) |
Fraction |
times(int other) |
Fraction |
times(int other,
boolean reduce) |
double |
toDouble() |
java.lang.String |
toString() |
java.lang.String |
toTex() |
public Fraction(int n)
public Fraction(int numerator,
int denominator)
public int getNumerator()
public int getDenominator()
public Fraction reduce()
public Fraction reciprocal()
public Fraction abs()
public Fraction plus(int other)
public Fraction plus(int other, boolean reduce)
public Fraction minus(int other)
public Fraction minus(int other, boolean reduce)
public Fraction times(int other)
public Fraction times(int other, boolean reduce)
public Fraction div(int other)
public Fraction div(int other, boolean reduce)
public Fraction pow(int n)
public Fraction pow(int n, boolean reduce)
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toTex()
toTex in interface TexElementpublic double toDouble()
protected Fraction sqrt()
public boolean sqrtIsRational()