Rational
Rational data type.
Public Methods
void FromFloat
Sets the numerator and denominator based on the decimal rational and with the provided denominator.
public void FromFloat(
float value,
int denominator
)
Parameters
Type | Name | Description |
---|---|---|
float | value | The decimal rational value. |
int | denominator | The denominator used in the rational. |
float ToFloat
Returns the rational value as a decimal.
public float ToFloat()
Returns: The rational value.
override string ToString
Provides a string representation of the numerator and denominator.
public override string ToString()
Returns: A string representation of the numerator and denominator.
Public Attributes
Denominator
Denominator.
public int Denominator;
Numerator
Numerator.
public int Numerator;