isLessThan static method

bool isLessThan(
  1. double value,
  2. FloatLength type
)

Whether value fits in type without loss, without needing to construct a FloatUtils first.

Implementation

static bool isLessThan(double value, FloatLength type) {
  switch (type) {
    case FloatLength.bytes16:
      return _computeFits(value).$1;
    case FloatLength.bytes32:
      return _computeFits(value).$2;
    case FloatLength.bytes64:
      return true; // every double fits in float64, trivially
  }
}