Version: 2021.3
LanguageEnglish
  • C#

MediaRational

struct in UnityEditor.Media

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Rational number useful for expressing fractions precisely.

Static Properties

Property Description
InvalidInvalid rational value.

Properties

Property Description
denominatorFraction denominator.
inverseThe inverse of the rational number.
isNegativeWhether the rational number is negative.
isValidWhether the rational number is valid.
isZeroWhether the rational number is zero.
numeratorFraction numerator.

Constructors

Constructor Description
MediaRationalConstructs a rational number. The version that omits the denominator sets it to 1.

Public Methods

Method Description
SetSets the numerator and denominator, performing normalization.

Operators

Operator Description
doubleReturns the rational value expressed as a floating point value.