Table of Contents

Class REAL

Namespace
L5Sharp.Types.Atomics
Assembly
L5Sharp.dll

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

radix Radix

The Radix number format of the value.

REAL(float)

Creates a new REAL with the provided value.

public REAL(float value)

Parameters

value float

The 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 float

The value to initialize the type with.

radix Radix

The 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

string

A string name identifying the logix type.

Radix

The radix format for the AtomicType.

public override Radix Radix { get; }

Property Value

Radix

A Radix representing the format of the atomic type 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 object

An 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:
Value

Meaning

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 object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetBytes()

Returns the AtomicType value as an array of byte values.

public override byte[] GetBytes()

Returns

byte[]

An array of byte representing the value of the type.

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 string

The string value to parse.

Returns

REAL

A REAL representing the parsed value.

Exceptions

FormatException

The Radix format can not be inferred from value.

Operators

implicit operator float(REAL)

Converts the provided REAL to a float value.

public static implicit operator float(REAL atomic)

Parameters

atomic REAL

The value to convert.

Returns

float

A float type value.

implicit operator string(REAL)

Implicitly converts the provided REAL to a string value.

public static implicit operator string(REAL value)

Parameters

value REAL

The value to convert.

Returns

string

A new string value.

implicit operator REAL(float)

Converts the provided float to a REAL value.

public static implicit operator REAL(float value)

Parameters

value float

The value to convert.

Returns

REAL

A REAL value.

implicit operator REAL(string)

Implicitly converts a string to a REAL value.

public static implicit operator REAL(string value)

Parameters

value string

The value to convert.

Returns

REAL

A new REAL value.