The FIRational structure represents a fraction via two Int32
instances which are interpreted as numerator and denominator.
Namespace:
FreeImageAPIAssembly: FreeImageNET (in FreeImageNET.dll)
Syntax
C# |
---|
[SerializableAttribute] public struct FIRational : IConvertible, IComparable, IFormattable, IComparable<FIRational>, IEquatable<FIRational> |
Visual Basic (Declaration) |
---|
<SerializableAttribute> _ Public Structure FIRational _ Implements IConvertible, IComparable, IFormattable, IComparable(Of FIRational), _ IEquatable(Of FIRational) |
Visual C++ |
---|
[SerializableAttribute] public value class FIRational : IConvertible, IComparable, IFormattable, IComparable<FIRational>, IEquatable<FIRational> |
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.