SignMagnitudeValue class

An immutable representation of a sign-magnitude value.

Implemented types
Annotations

Constructors

SignMagnitudeValue({required LogicValue sign, required LogicValue magnitude})
Construct a SignMagnitudeValue from a sign and magnitude.
factory
SignMagnitudeValue.uninitialized()
Creates an unpopulated version of a SignMagnitudeValue, intended to be called with the populator.

Properties

hashCode → int
The hash code for this object.
no setteroverride
magnitude ↔ LogicValue
The magnitude bits.
latefinal
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sign ↔ LogicValue
The sign bit.
latefinal
value → LogicValue
The sign magnitude value is stored as sign and magnitude, but the combined value is also provided for convenience.
latefinal
width ↔ int
width is the width of the magnitude.
latefinal

Methods

clonePopulator() → SignMagnitudeValuePopulator<SignMagnitudeValue>
Creates a SignMagnitudeValuePopulator for the same type as this and with the same widths.
compareTo(Object other) → int
Returns a negative integer if this less than other, a positive integer if this greater than other, and zero if this and other are equal.
override
negate() → SignMagnitudeValue
Negate operation for SignMagnitudeValue.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toBigInt() → BigInt
Convert to BigInt.
toInt() → int
Convert to int, throwing an exception if out of range.
toString() → String
Return a string representation of SignMagnitudeValue. Return sign, integer, fraction as binary strings.
override

Operators

operator <(SignMagnitudeValue other) → bool
Less-than operator for SignMagnitudeValue.
operator <=(SignMagnitudeValue other) → bool
Less-than-or-equal operator for SignMagnitudeValue.
operator ==(Object other) → bool
The equality operator.
override
operator >(SignMagnitudeValue other) → bool
Greater-than operator for SignMagnitudeValue.
operator >=(SignMagnitudeValue other) → bool
Greater-than-or-equal operator for SignMagnitudeValue.

Static Methods

populator({required int width}) → SignMagnitudeValuePopulator<SignMagnitudeValue>
Creates a SignMagnitudeValuePopulator with the provided width which can then be used to complete construction of a SignMagnitudeValue using population functions.