Class REAL
Represents a REAL Logix atomic data type, or a type analogous to a float.
public sealed class REAL : AtomicType, ILogixSerializable, IComparable, IConvertible
- Inheritance
-
REAL
- Implements
- Inherited Members
Constructors
REAL()
Creates a new default REAL type.
public REAL()
REAL(Radix)
Creates a new REAL value with the provided radix format.
public REAL(Radix radix)
Parameters
REAL(float)
Creates a new REAL with the provided value.
public REAL(float value)
Parameters
value
floatThe value to initialize the type with.
REAL(float, Radix)
Creates a new REAL with the provided value.
public REAL(float value, Radix radix)
Parameters
value
floatThe 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 REAL.
public static REAL 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 float(REAL)
public static implicit operator float(REAL atomic)
Parameters
atomic
REALThe value to convert.
Returns
implicit operator string(REAL)
public static implicit operator string(REAL value)
Parameters
value
REALThe value to convert.
Returns
implicit operator REAL(float)
public static implicit operator REAL(float value)
Parameters
value
floatThe value to convert.
Returns
implicit operator REAL(string)
public static implicit operator REAL(string value)
Parameters
value
stringThe value to convert.