MediaRational
Rational number useful for expressing fractions precisely.
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Struct
- Namespace: UnityEditor.Media
- Assembly: UnityEditor
public struct MediaRational
Fields
Value | Description |
|---|---|
| denominator | Fraction denominator. |
| numerator | Fraction numerator. |
Static Fields
Value | Description |
|---|---|
| Invalid | Invalid rational value. |
Constructors
Constructor | Description |
|---|---|
| MediaRational(System.Int32) | Constructs a rational number. The version that omits the denominator sets it to 1. |
| MediaRational(System.Int32,System.Int32) | Constructs a rational number. The version that omits the denominator sets it to 1. |
Properties
Property | Description |
|---|---|
| inverse | The inverse of the rational number. |
| isNegative | Whether the rational number is negative. |
| isValid | Whether the rational number is valid. |
| isZero | Whether the rational number is zero. |
Methods
Method | Description |
|---|---|
| Set | Sets the numerator and denominator, performing normalization. |
Operators
Operator | Description |
|---|---|
| double | Returns the rational value expressed as a floating point value. |