示例#1
0
 public int CompareTo(BigDec that)
 {
     if (this.mantissa == that.mantissa && this.exponent == that.exponent)
     {
         return(0);
     }
     else
     {
         BigDec d = this - that;
         return(d.IsNegative ? -1 : 1);
     }
 }
示例#2
0
 public static BigFloat FromBigDec(BigDec v, int significandSize, int exponentSize)
 {
     return(new BigFloat(v.ToDecimalString(), significandSize, exponentSize));
 }
示例#3
0
 public static BigFloat FromBigDec(BigDec v)
 {
     return(new BigFloat(v.ToDecimalString(), 24, 8));
 }
示例#4
0
 public int CompareTo(BigDec that)
 {
     if (this.mantissa == that.mantissa && this.exponent == that.exponent) {
     return 0;
       }
       else {
     BigDec d = this - that;
     return d.IsNegative ? -1 : 1;
       }
 }
示例#5
0
文件: Parser.cs 项目: qunyanm/boogie
	void Dec(out BigDec n) {
		string s = ""; 
		if (la.kind == 5) {
			Get();
			s = t.val; 
		} else if (la.kind == 6) {
			Get();
			s = t.val; 
		} else SynErr(127);
		try {
		 n = BigDec.FromString(s);
		} catch (FormatException) {
		 this.SemErr("incorrectly formatted number");
		 n = BigDec.ZERO;
		}
		
	}
示例#6
0
 public static BigFloat FromBigDec(BigDec v, int significandSize, int exponentSize)
 {
   return new BigFloat(v.ToDecimalString(), significandSize, exponentSize);
 }
示例#7
0
 public static BigFloat FromBigDec(BigDec v)
 {
   return new BigFloat(v.ToDecimalString(), 24, 8);
 }
示例#8
0
 public LiteralExpr ConstantReal(Microsoft.Basetypes.BigDec value)
 {
     return(new LiteralExpr(Token.NoToken, value, Immutable));
 }