Table of Contents

Struct Rational

Namespace
Stride.Graphics
Assembly
Stride.Graphics.dll

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

numerator int
denominator int

Fields

Denominator

An unsigned integer value representing the bottom of the rational number.

public int Denominator

Field Value

int

Numerator

An unsigned integer value representing the top of the rational number.

public int Numerator

Field Value

int

Methods

Equals(Rational)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Rational other)

Parameters

other Rational

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The 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

left Rational
right Rational

Returns

bool

operator !=(Rational, Rational)

public static bool operator !=(Rational left, Rational right)

Parameters

left Rational
right Rational

Returns

bool