Class LREAL
Represents a LREAL Logix atomic data type, or a type analogous to a double.
public sealed class LREAL : AtomicType, ILogixSerializable, IComparable, IConvertible
- Inheritance
-
LREAL
- Implements
- Inherited Members
Constructors
LREAL()
Creates a new default LREAL type.
public LREAL()
LREAL(Radix)
Creates a new LREAL value with the provided radix format.
public LREAL(Radix radix)
Parameters
LREAL(double)
Creates a new LREAL with the provided value.
public LREAL(double value)
Parameters
value
doubleThe value to initialize the type with.
LREAL(double, Radix)
Creates a new INT with the provided value.
public LREAL(double value, Radix radix)
Parameters
value
doubleThe value to initialize the type with.
radix
RadixThe optional radix format of the value.
Properties
Members
The collection of LogixMember objects that make up the structure of the type.
public override IEnumerable<LogixMember> Members { get; }
Property Value
- IEnumerable<LogixMember>
A IEnumerable<T> containing LogixMember objects.
Remarks
All logix types, with the exception of a BOOL
and REAL/LREAL
, have what can be considered
members. Every derived type must implement this property for which it returns a collection of members, forming
the type/member hierarchy of the logix type.
Name
The name of the logix type.
public override string Name { get; }
Property Value
Radix
The radix format for the AtomicType.
public override Radix Radix { get; }
Property Value
Methods
CompareTo(object?)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(object? obj)
Parameters
obj
objectAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
ValueMeaning
Less than zero
This instance precedes
obj
in the sort order.Zero
This instance occurs in the same position in the sort order as
obj
.Greater than zero
This instance follows
obj
in the sort order.
Exceptions
- ArgumentException
obj
is not the same type as this instance.
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
GetBytes()
Returns the AtomicType value as an array of byte values.
public override byte[] GetBytes()
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
Parse(string)
Parses the provided string value to a new LREAL.
public static LREAL Parse(string value)
Parameters
value
stringThe string value to parse.
Returns
Exceptions
- FormatException
The Radix format can not be inferred from
value
.
Operators
implicit operator double(LREAL)
public static implicit operator double(LREAL atomic)
Parameters
atomic
LREALThe value to convert.
Returns
implicit operator string(LREAL)
public static implicit operator string(LREAL value)
Parameters
value
LREALThe value to convert.
Returns
implicit operator LREAL(double)
public static implicit operator LREAL(double value)
Parameters
value
doubleThe value to convert.
Returns
implicit operator LREAL(string)
public static implicit operator LREAL(string value)
Parameters
value
stringThe value to convert.