Ejemplo n.º 1
0
        public static string ToCastString(this ConcreteFloat f)
        {
            Contract.Ensures(Contract.Result <string>() != null);

            switch (f)
            {
            case ConcreteFloat.Float32:
                return("(float)");

            case ConcreteFloat.Float64:
                return("(double)");

            case ConcreteFloat.Float80:
            case ConcreteFloat.Uncompatible:
            default:
                return("");
            }
        }
                private bool TryFloatType(APC pc, Variable var, out ConcreteFloat type)
                {
                    var flattype = this.Context.ValueContext.GetType(pc, var);

                    if (flattype.IsNormal)
                    {
                        var emb = flattype.Value;

                        if (emb.Equals(this.DecoderForMetaData.System_Single))
                        {
                            type = ConcreteFloat.Float32;
                            return(true);
                        }

                        if (emb.Equals(this.DecoderForMetaData.System_Double))
                        {
                            type = ConcreteFloat.Float64;
                            return(true);
                        }
                    }

                    type = default(ConcreteFloat);
                    return(false);
                }
Ejemplo n.º 3
0
 public bool TryGetFloatType(APC pc, BoxedExpression exp, out ConcreteFloat type)
 {
     type = default(ConcreteFloat);
     return(false);
 }
 public void SetFloatType(Variable v, ConcreteFloat f)
 {
     // does nothing
 }
Ejemplo n.º 5
0
 public void SetFloatType(Variable v, ConcreteFloat f)
 {
     this[v] = new FlatAbstractDomain <ConcreteFloat>(f);
 }
Ejemplo n.º 6
0
 public bool TrySuggestFloatingPointComparisonFix(ProofObligation obl, APC pc, BoxedExpression left, BoxedExpression right, ConcreteFloat leftType, ConcreteFloat rightType)
 {
     return(false);
 }
Ejemplo n.º 7
0
 public bool TrySuggestFloatingPointComparisonFix(ProofObligation obl, APC pc, BoxedExpression left, BoxedExpression right, ConcreteFloat leftType, ConcreteFloat rightType)
 {
     return(ProfileAndTrace("Floating point comparison", inner.TrySuggestFloatingPointComparisonFix(obl, pc, left, right, leftType, rightType), ref FloatComparisonMismatchesFixes));
 }