/// <summary> /// Creates an integer value from the given integer and an integer spec. /// </summary> public IntegerConstant(BigInteger value, IntegerSpec spec) { ContractHelpers.Assert(spec != null); this.Value = value; this.Spec = spec; }
/// <summary> /// Casts this integer value to match the given spec. /// </summary> public IntegerConstant Cast(IntegerSpec newSpec) { var result = new IntegerConstant(newSpec.Cast(Value, Spec), newSpec); ContractHelpers.Assert(result.Spec.Equals(newSpec)); AssertIsValid(result); return(result); }