Constructor and Description |
---|
SRational(int numerator,
int denominator)
Initializes a new instance of the
SRational class. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Indicates whether the current object is equal to another object of the same type.
|
boolean |
equals(SRational other)
Indicates whether the current object is equal to another object of the same type.
|
static boolean |
equals(SRational rational,
SRational other)
Compares pair of
SRational . |
int |
getDenominator()
Gets denominator.
|
int |
getNumerator()
Gets numerator.
|
double |
getValue()
Gets actual value represented as double.
|
int |
hashCode()
Returns a hash code for this instance.
|
String |
toString()
Returns a
System.String that represents this instance. |
public SRational(int numerator, int denominator)
Initializes a new instance of the SRational
class.
numerator
- The numerator.denominator
- The denominator.com.aspose.ms.System.ArgumentOutOfRangeException
- denominator;Denominator should be grater then zeropublic final int getNumerator()
Gets numerator.
Value: The numerator.public final int getDenominator()
Gets denominator.
Value: The denominator.public final double getValue()
Gets actual value represented as double.
Value: Double value.public static boolean equals(SRational rational, SRational other)
Compares pair of SRational
.
rational
- Comparing item.other
- Other item.true
if objects are equal; otherwise false
.public final boolean equals(SRational other)
Indicates whether the current object is equal to another object of the same type.
other
- An object to compare with this object.true
if the current object is equal to the other
parameter; otherwise, false
.public boolean equals(Object obj)
Indicates whether the current object is equal to another object of the same type.
public int hashCode()
Returns a hash code for this instance.
Copyright © 2017. All rights reserved.