isNormal method
Return true
if this FloatingPointValue contains a normal
number, defined as having mantissa in the range [1,2)
.
Implementation
bool isNormal() {
if (explicitJBit) {
final e = exponent.toInt();
final m = mantissa.toInt();
final int normMantissa;
if (e < mantissa.width) {
normMantissa = 1 << (mantissa.width - e - 1);
} else {
normMantissa = 1;
}
return (e > 0) && (m >= normMantissa);
} else {
return exponent != LogicValue.ofInt(0, exponent.width);
}
}