Beispiel #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);
     }
 }
Beispiel #2
0
 public static BigFloat FromBigDec(BigDec v, int significandSize, int exponentSize)
 {
     return(new BigFloat(v.ToDecimalString(), significandSize, exponentSize));
 }
Beispiel #3
0
 public static BigFloat FromBigDec(BigDec v)
 {
     return(new BigFloat(v.ToDecimalString(), 24, 8));
 }
Beispiel #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;
       }
 }
Beispiel #5
0
	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;
		}
		
	}
Beispiel #6
0
 public static BigFloat FromBigDec(BigDec v, int significandSize, int exponentSize)
 {
   return new BigFloat(v.ToDecimalString(), significandSize, exponentSize);
 }
Beispiel #7
0
 public static BigFloat FromBigDec(BigDec v)
 {
   return new BigFloat(v.ToDecimalString(), 24, 8);
 }
Beispiel #8
0
 public LiteralExpr ConstantReal(Microsoft.Basetypes.BigDec value)
 {
     return(new LiteralExpr(Token.NoToken, value, Immutable));
 }