A {@code double} specialized version of {@link #checkPostcondition(Object,
ContractConditionType)}.

@param value     The value
@param condition The predicate

@return value

@throws PostconditionViolationException If the predicate is false
481093
public static double checkPostconditionD(
    final double value,
    final ContractDoubleConditionType condition)
    throws PostconditionViolationException
  {
    return checkPostconditionD(
      value, condition.predicate(), condition.describer());
  }
261022
public final Condition lt(final V value) {
        return new Condition().withComparisonOperator(LT).withAttributeValueList(convert(value));
    }
452148
public static Double checkNull(Double value, Double elseValue) {
        return isNull(value) ? elseValue : value;
    }
1078346
public double setFixedValue(double value) throws IOException, SaneException {
    Preconditions.checkArgument(
        value >= -32768 && value <= 32767.9999, "value " + value + " is out of range");
    SaneWord wordValue = SaneWord.forFixedPrecision(value);
    ControlOptionResult result = writeOption(wordValue);
    Preconditions.checkState(
        result.getType() == OptionValueType.FIXED,
        "setFixedValue is not appropriate for option of type " + result.getType());

    return SaneWord.fromBytes(result.getValue()).fixedPrecisionValue();
  }
981806
public static ParenthesizedCondition getInstance(Condition condition) {
        return condition instanceof ParenthesizedCondition ? (ParenthesizedCondition) condition
                : new ParenthesizedCondition(condition);
    }
1005124
public final Condition ge(final V value) {
        return new Condition().withComparisonOperator(GE).withAttributeValueList(convert(value));
    }
273415
@Override
	public boolean isValid(Number value, ConstraintValidatorContext constraintContext) {
		
		// Si l'objet est null
		if(value == null) return false;

		// On retourne la comparaison
		return (min.doubleValue() <= value.doubleValue()) && (max.doubleValue() >= value.doubleValue());
	}
1269324
public static Expression constant(final double value) {
    return new Expression(Type.DOUBLE_TYPE, Feature.CHEAP) {
      @Override
      protected void doGen(CodeBuilder mv) {
        mv.pushDouble(value);
      }
    };
  }
1106476
private double checkThreshold(int value) {
    double threshold = (double) value;
    try {
      if (threshold < 0 || threshold > 100) {
        throw new NumberFormatException();
      }
      LOG.info("Using a threshold of " + threshold);
    } catch (NumberFormatException e) {
      System.err.println("Expect a double parameter in the range of [0, 100]: "
          + value);
      throw e;
    }
    return threshold;
  }
463656
public static final BigInteger printConstraintType(ConstraintType value)
   {
      return (value == null ? null : BigInteger.valueOf(value.getValue()));
   }
621262
static EvaluatedCondition evaluate(Condition condition, QualityGateEvaluator.Measures measures) {
    Optional<QualityGateEvaluator.Measure> measure = measures.get(condition.getMetricKey());
    if (!measure.isPresent()) {
      return new EvaluatedCondition(condition, EvaluationStatus.OK, null);
    }

    Optional<Comparable> value = getMeasureValue(condition, measure.get());
    if (!value.isPresent()) {
      return new EvaluatedCondition(condition, EvaluationStatus.OK, null);
    }

    ValueType type = measure.get().getType();
    return evaluateCondition(condition, type, value.get())
      .orElseGet(() -> new EvaluatedCondition(condition, EvaluationStatus.OK, value.get().toString()));
  }
1211123
public final void resolve(X value) {
		Preconditions.checkState(!resolved, "This parameter was already resolved.");
		this.value = Preconditions.checkNotNull(value);
		this.resolved = true;
	}
1083646
public static String getPostfixFromValue(String value) {
    String postfix = "";
    Matcher m = patternPrePostFix.matcher(value);
    if (m.find()) {
      postfix = m.group(2);

    }
    return postfix;
  }
946923
public static Double checkNull(Double value, double elseValue) {
        return checkNull(value, Double.valueOf(elseValue));
    }
1010830
private void generatePostconditionChecks(WyilFile.Stmt.Return stmt, Expr[] exprs, Context context) {
		WyilFile.Decl.FunctionOrMethod declaration = (WyilFile.Decl.FunctionOrMethod) context.getEnvironment()
				.getParent().enclosingDeclaration;
		WyilFile.Tuple<WyilFile.Expr> postcondition = declaration.getEnsures();
		Tuple<WyilFile.Decl.Variable> parameters = declaration.getParameters();
		Tuple<WyilFile.Decl.Variable> returns = declaration.getReturns();
		// First, check whether or not there are any postconditions!
		if (postcondition.size() > 0) {
			// There is at least one return value and at least one
			// postcondition clause. Therefore, we need to check the return
			// values against the post condition(s). One of the difficulties
			// here is that the postcondition will refer to parameters as
			// they were on entry to the function/method, not as they are
			// now.
			Expr[] arguments = new Expr[parameters.size() + returns.size()];
			// Translate parameters as arguments to post-condition
			// invocation
			for (int i = 0; i != parameters.size(); ++i) {
				WyilFile.Decl.Variable var = parameters.get(i);
				WyalFile.VariableDeclaration vd = context.readFirst(var);
				arguments[i] = new Expr.VariableAccess(vd);
			}
			// Copy over return expressions as arguments for invocation(s)
			System.arraycopy(exprs, 0, arguments, parameters.size(), exprs.length);
			//
			// Finally, generate an appropriate verification condition to
			// check each postcondition clause
			for (int i = 0; i != postcondition.size(); ++i) {
				Name ident = convert(declaration.getQualifiedName(), "_ensures_" + i, declaration.getName());
				Expr clause = new Expr.Invoke(null, ident, null, arguments);
				context.emit(new VerificationCondition("postcondition may not be satisfied", context.assumptions,
						clause, stmt.getParent(WyilFile.Attribute.Span.class)));
			}
		}
	}
1093511
public static Double toDouble(Object v) {
        if (v == null) {
            return null;
        }
        if (v instanceof Boolean) {
            return ((Boolean) v) ? 1.0 : 0.0;
        }
        return ((Number) v).doubleValue();
    }
675837
public static long checkPostconditionL(
    final long value,
    final ContractLongConditionType condition)
    throws PostconditionViolationException
  {
    return checkPostconditionL(
      value, condition.predicate(), condition.describer());
  }