Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    Rational Struct

    Namespace: Stride.Graphics
    Assembly: Stride.Graphics.dll

    Represents a rational number.

    public struct Rational : IEquatable<Rational>
    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.

    Name Description
    Constructors
    Rational(Int32, Int32)
    Fields
    Denominator

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

    Numerator

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

    Methods
    Equals(Rational)
    Equals(Object)
    GetHashCode()
    ToString()
    Operators
    Equality(Rational, Rational)
    Inequality(Rational, Rational)
    | Improve this Doc View Source

    Constructors


    Rational(Int32, Int32)

    public Rational(int numerator, int denominator)
    Parameters
    Type Name Description
    System.Int32 numerator
    System.Int32 denominator
    | Improve this Doc View Source

    Fields


    Denominator

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

    public int Denominator
    Field Value
    Type Description
    System.Int32

    Numerator

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

    public int Numerator
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Methods


    Equals(Rational)

    public bool Equals(Rational other)
    Parameters
    Type Name Description
    Rational other
    Returns
    Type Description
    System.Boolean

    Equals(Object)

    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.ValueType.Equals(System.Object)

    GetHashCode()

    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.ValueType.GetHashCode()

    ToString()

    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.ValueType.ToString()
    | Improve this Doc View Source

    Operators


    Equality(Rational, Rational)

    public static bool operator ==(Rational left, Rational right)
    Parameters
    Type Name Description
    Rational left
    Rational right
    Returns
    Type Description
    System.Boolean

    Inequality(Rational, Rational)

    public static bool operator !=(Rational left, Rational right)
    Parameters
    Type Name Description
    Rational left
    Rational right
    Returns
    Type Description
    System.Boolean

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation