public static Fraction fromFloat(final float val) {
    checkArgument(val > 0.0f && val <= 1.0f);
    return new Fraction(val);
  }
From float to fraction.

@param val the val
@return the fraction
util/src/main/java/org/hyperledger/besu/util/number/Fraction.java