FIRational Structure

FreeImage.NET

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)
Syntax
C#
[SerializableAttribute]
public struct FIRational : IConvertible, 
	IComparable, IFormattable, IComparable<FIRational>, IEquatable<FIRational>

The FIRational type exposes the following members.

Constructors
  NameDescription
Public methodFIRational(Decimal)
Initializes a new instance based on the specified parameters.
Public methodFIRational(FITAG)
Initializes a new instance based on the specified parameters.
Public methodFIRational(Int32, Int32)
Initializes a new instance based on the specified parameters.
Top
Properties
  NameDescription
Public propertyDenominator
The denominator of the fraction.
Public propertyIsInteger
Returns whether the fraction is representing an integer value.
Public propertyNumerator
The numerator of the fraction.
Top
Methods
  NameDescription
Public methodCompareTo(Object)
Compares this instance with a specified Object.
Public methodCompareTo(FIRational)
Compares this instance with a specified FIRational object.
Public methodEquals(Object)
Tests whether the specified object is a FIRational structure and is equivalent to this FIRational structure.
(Overrides ValueTypeEquals(Object).)
Public methodEquals(FIRational)
Tests whether the specified FIRational structure is equivalent to this FIRational structure.
Public methodGetHashCode
Returns a hash code for this FIRational structure.
(Overrides ValueTypeGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Converts the numeric value of the FIRational object to its equivalent string representation.
(Overrides ValueTypeToString.)
Public methodToString(String, IFormatProvider)
Formats the value of the current instance using the specified format.
Public methodTruncate
Returns the truncated value of the fraction.
Top
Operators
  NameDescription
Public operatorStatic memberAddition
Standard implementation of the operator.
Public operatorStatic memberDecrement
Standard implementation of the operator.
Public operatorStatic memberDivision
Standard implementation of the operator.
Public operatorStatic memberEquality
Standard implementation of the operator.
Public operatorStatic member(Boolean to FIRational)
Converts the value of a Boolean structure to a FIRational structure.
Public operatorStatic member(Decimal to FIRational)
Converts the value of a Decimal structure to a FIRational structure.
Public operatorStatic member(Double to FIRational)
Converts the value of a Double structure to a FIRational structure.
Public operatorStatic member(Int64 to FIRational)
Converts the value of an Int64 structure to a FIRational structure.
Public operatorStatic member(Single to FIRational)
Converts the value of a Single structure to a FIRational structure.
Public operatorStatic member(UInt32 to FIRational)
Converts the value of an UInt32 structure to a FIRational structure.
Public operatorStatic member(UInt64 to FIRational)
Converts the value of an UInt64 structure to a FIRational structure.
Public operatorStatic member(FIRational to Boolean)
Converts the value of a FIRational structure to a Boolean structure.
Public operatorStatic member(FIRational to Byte)
Converts the value of a FIRational structure to a Byte structure.
Public operatorStatic member(FIRational to Char)
Converts the value of a FIRational structure to a Char structure.
Public operatorStatic member(FIRational to Int16)
Converts the value of a FIRational structure to an Int16 structure.
Public operatorStatic member(FIRational to Int32)
Converts the value of a FIRational structure to an Int32 structure.
Public operatorStatic member(FIRational to Int64)
Converts the value of a FIRational structure to an Int64 structure.
Public operatorStatic member(FIRational to SByte)
Converts the value of a FIRational structure to a SByte structure.
Public operatorStatic member(FIRational to UInt16)
Converts the value of a FIRational structure to an UInt16 structure.
Public operatorStatic member(FIRational to UInt32)
Converts the value of a FIRational structure to an UInt32 structure.
Public operatorStatic member(FIRational to UInt64)
Converts the value of a FIRational structure to an UInt64 structure.
Public operatorStatic memberGreaterThan
Standard implementation of the operator.
Public operatorStatic memberGreaterThanOrEqual
Standard implementation of the operator.
Public operatorStatic member(Byte to FIRational)
Converts the value of a Byte structure to a FIRational structure.
Public operatorStatic member(Char to FIRational)
Converts the value of a Char structure to a FIRational structure.
Public operatorStatic member(Int16 to FIRational)
Converts the value of an Int16 structure to a FIRational structure.
Public operatorStatic member(Int32 to FIRational)
Converts the value of an Int32 structure to a FIRational structure.
Public operatorStatic member(SByte to FIRational)
Converts the value of a SByte structure to a FIRational structure.
Public operatorStatic member(UInt16 to FIRational)
Converts the value of an UInt16 structure to a FIRational structure.
Public operatorStatic member(FIRational to Decimal)
Converts the value of a FIRational structure to a Decimal structure.
Public operatorStatic member(FIRational to Double)
Converts the value of a FIRational structure to a Double structure.
Public operatorStatic member(FIRational to Single)
Converts the value of a FIRational structure to a Single structure.
Public operatorStatic memberIncrement
Standard implementation of the operator.
Public operatorStatic memberInequality
Standard implementation of the operator.
Public operatorStatic memberLessThan
Standard implementation of the operator.
Public operatorStatic memberLessThanOrEqual
Standard implementation of the operator.
Public operatorStatic memberModulus
Standard implementation of the operator.
Public operatorStatic memberMultiply
Standard implementation of the operator.
Public operatorStatic memberOnesComplement
Returns the reciprocal value of this instance.
Public operatorStatic memberSubtraction
Standard implementation of the operator.
Public operatorStatic memberUnaryNegation
Standard implementation of the operator.
Public operatorStatic memberUnaryPlus
Standard implementation of the operator.
Top
Fields
  NameDescription
Public fieldStatic memberEpsilon
Represents the smallest positive FIRational value greater than zero. This field is constant.
Public fieldStatic memberMaxValue
Represents the largest possible value of FIRational. This field is constant.
Public fieldStatic memberMinValue
Represents the smallest possible value of FIRational. This field is constant.
Top
Remarks
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.

See Also