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