Struct Rational
Represents a rational number.
public struct Rational : IEquatable<Rational>
- Implements
Remarks
The SharpDX.DXGI.Rational structure operates under the following rules:
- 0/0 is legal and will be interpreted as 0/1.
- 0/anything is interpreted as zero.
- If you are representing a whole number, the denominator should be 1.
Constructors
Rational(int, int)
public Rational(int numerator, int denominator)
Parameters
Fields
Denominator
An unsigned integer value representing the bottom of the rational number.
public int Denominator
Field Value
Numerator
An unsigned integer value representing the top of the rational number.
public int Numerator
Field Value
Methods
Equals(Rational)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Rational other)
Parameters
other
RationalAn object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator ==(Rational, Rational)
public static bool operator ==(Rational left, Rational right)
Parameters
Returns
operator !=(Rational, Rational)
public static bool operator !=(Rational left, Rational right)