FreeImage.NET Class Library Reference
![]() | FIRational Structure |
The FIRational structure represents a fraction via two Int32
instances which are interpreted as numerator and denominator.
Namespace: FreeImageAPI
Assembly: FreeImageNET (in FreeImageNET.dll) Version: 3.17.0.4 (3.17.0)

C#
[SerializableAttribute] public struct FIRational : IConvertible, IComparable, IFormattable, IComparable<FIRational>, IEquatable<FIRational>
The FIRational type exposes the following members.

Name | Description | |
---|---|---|
![]() | FIRational(Decimal) |
Initializes a new instance based on the specified parameters.
|
![]() | FIRational(FITAG) |
Initializes a new instance based on the specified parameters.
|
![]() | FIRational(Int32, Int32) |
Initializes a new instance based on the specified parameters.
|

Name | Description | |
---|---|---|
![]() | Denominator |
The denominator of the fraction.
|
![]() | IsInteger |
Returns whether the fraction is representing an integer value.
|
![]() | Numerator |
The numerator of the fraction.
|

Name | Description | |
---|---|---|
![]() | CompareTo(Object) |
Compares this instance with a specified Object.
|
![]() | CompareTo(FIRational) |
Compares this instance with a specified FIRational object.
|
![]() | Equals(Object) |
Tests whether the specified object is a FIRational structure
and is equivalent to this FIRational structure.
(Overrides ValueTypeEquals(Object).) |
![]() | Equals(FIRational) |
Tests whether the specified FIRational structure is equivalent to this FIRational structure.
|
![]() | GetHashCode |
Returns a hash code for this FIRational structure.
(Overrides ValueTypeGetHashCode.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | ToString |
Converts the numeric value of the FIRational object
to its equivalent string representation.
(Overrides ValueTypeToString.) |
![]() | ToString(String, IFormatProvider) |
Formats the value of the current instance using the specified format.
|
![]() | Truncate |
Returns the truncated value of the fraction.
|

Name | Description | |
---|---|---|
![]() ![]() | Addition |
Standard implementation of the operator.
|
![]() ![]() | Decrement |
Standard implementation of the operator.
|
![]() ![]() | Division |
Standard implementation of the operator.
|
![]() ![]() | Equality |
Standard implementation of the operator.
|
![]() ![]() | (Boolean to FIRational) |
Converts the value of a Boolean structure to a FIRational structure.
|
![]() ![]() | (Decimal to FIRational) |
Converts the value of a Decimal structure to a FIRational structure.
|
![]() ![]() | (Double to FIRational) |
Converts the value of a Double structure to a FIRational structure.
|
![]() ![]() | (Int64 to FIRational) |
Converts the value of an Int64 structure to a FIRational structure.
|
![]() ![]() | (Single to FIRational) |
Converts the value of a Single structure to a FIRational structure.
|
![]() ![]() | (UInt32 to FIRational) |
Converts the value of an UInt32 structure to a FIRational structure.
|
![]() ![]() | (UInt64 to FIRational) |
Converts the value of an UInt64 structure to a FIRational structure.
|
![]() ![]() | (FIRational to Boolean) |
Converts the value of a FIRational structure to a Boolean structure.
|
![]() ![]() | (FIRational to Byte) |
Converts the value of a FIRational structure to a Byte structure.
|
![]() ![]() | (FIRational to Char) |
Converts the value of a FIRational structure to a Char structure.
|
![]() ![]() | (FIRational to Int16) |
Converts the value of a FIRational structure to an Int16 structure.
|
![]() ![]() | (FIRational to Int32) |
Converts the value of a FIRational structure to an Int32 structure.
|
![]() ![]() | (FIRational to Int64) |
Converts the value of a FIRational structure to an Int64 structure.
|
![]() ![]() | (FIRational to SByte) |
Converts the value of a FIRational structure to a SByte structure.
|
![]() ![]() | (FIRational to UInt16) |
Converts the value of a FIRational structure to an UInt16 structure.
|
![]() ![]() | (FIRational to UInt32) |
Converts the value of a FIRational structure to an UInt32 structure.
|
![]() ![]() | (FIRational to UInt64) |
Converts the value of a FIRational structure to an UInt64 structure.
|
![]() ![]() | GreaterThan |
Standard implementation of the operator.
|
![]() ![]() | GreaterThanOrEqual |
Standard implementation of the operator.
|
![]() ![]() | (Byte to FIRational) |
Converts the value of a Byte structure to a FIRational structure.
|
![]() ![]() | (Char to FIRational) |
Converts the value of a Char structure to a FIRational structure.
|
![]() ![]() | (Int16 to FIRational) |
Converts the value of an Int16 structure to a FIRational structure.
|
![]() ![]() | (Int32 to FIRational) |
Converts the value of an Int32 structure to a FIRational structure.
|
![]() ![]() | (SByte to FIRational) |
Converts the value of a SByte structure to a FIRational structure.
|
![]() ![]() | (UInt16 to FIRational) |
Converts the value of an UInt16 structure to a FIRational structure.
|
![]() ![]() | (FIRational to Decimal) |
Converts the value of a FIRational structure to a Decimal structure.
|
![]() ![]() | (FIRational to Double) |
Converts the value of a FIRational structure to a Double structure.
|
![]() ![]() | (FIRational to Single) |
Converts the value of a FIRational structure to a Single structure.
|
![]() ![]() | Increment |
Standard implementation of the operator.
|
![]() ![]() | Inequality |
Standard implementation of the operator.
|
![]() ![]() | LessThan |
Standard implementation of the operator.
|
![]() ![]() | LessThanOrEqual |
Standard implementation of the operator.
|
![]() ![]() | Modulus |
Standard implementation of the operator.
|
![]() ![]() | Multiply |
Standard implementation of the operator.
|
![]() ![]() | OnesComplement |
Returns the reciprocal value of this instance.
|
![]() ![]() | Subtraction |
Standard implementation of the operator.
|
![]() ![]() | UnaryNegation |
Standard implementation of the operator.
|
![]() ![]() | UnaryPlus |
Standard implementation of the operator.
|

Name | Description | |
---|---|---|
![]() ![]() | Epsilon |
Represents the smallest positive FIRational value greater than zero. This field is constant.
|
![]() ![]() | MaxValue |
Represents the largest possible value of FIRational. This field is constant.
|
![]() ![]() | MinValue |
Represents the smallest possible value of FIRational. This field is constant.
|

The structure tries to approximate the value of FIRational(Decimal)
when creating a new instance by using a better algorithm than FreeImage does.
The structure implements the following operators: +, -, ++, --, ==, != , >, >==, <, <== and ~ (which switches nominator and denomiator).
The structure can be converted into all .NET standard types either implicit or explicit.
