Code example for BigInteger

Methods: equals

0
} 
 
public boolean equals(Object arg0){
	return arg0 != null
	       && arg0 instanceof Ratio
	       && ((Ratio) arg0).numerator.equals(numerator)
	       && ((Ratio) arg0).denominator.equals(denominator);
} 
 
public int hashCode(){ 
	return numerator.hashCode() ^ denominator.hashCode();
} 
 
public String toString(){
	return numerator.toString() + "/" + denominator.toString();
} 
 
public int intValue(){ 
	return (int) doubleValue(); 
}