Esempio n. 1
0
        /// <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;
        }
Esempio n. 2
0
        /// <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);
        }