// Converts a Decimal to a float. Since a float has fewer significant // digits than a Decimal, this operation may produce round-off errors. // public static float ToSingle(Decimal d) { return(DecCalc.VarR4FromDec(ref d)); }
// Subtracts two Decimal values. // public static Decimal Subtract(Decimal d1, Decimal d2) { DecCalc.VarDecSub(ref d1, ref d2); return(d1); }
// Converts a Decimal to a double. Since a double has fewer significant // digits than a Decimal, this operation may produce round-off errors. // public static double ToDouble(Decimal d) { return(DecCalc.VarR8FromDec(ref d)); }
// Rounds a Decimal to an integer value. The Decimal argument is rounded // towards negative infinity. // public static Decimal Floor(Decimal d) { DecCalc.VarDecInt(ref d); return(d); }
public static Decimal Remainder(Decimal d1, Decimal d2) { return(DecCalc.VarDecMod(ref d1, ref d2)); }
public Decimal(double value) { DecCalc.VarDecFromR8(value, out AsMutable(ref this)); }
// Multiplies two Decimal values. // public static Decimal Multiply(Decimal d1, Decimal d2) { DecCalc.VarDecMul(ref d1, ref d2); return(d1); }
public int CompareTo(Decimal value) { return(DecCalc.VarDecCmp(ref this, ref value)); }
// Divides two Decimal values. // public static Decimal Divide(Decimal d1, Decimal d2) { DecCalc.VarDecDiv(ref d1, ref d2); return(d1); }
// Adds two Decimal values. // public static Decimal Add(Decimal d1, Decimal d2) { DecCalc.VarDecAdd(ref d1, ref d2); return(d1); }
// Compares two Decimal values, returning an integer that indicates their // relationship. // public static int Compare(Decimal d1, Decimal d2) { return(DecCalc.VarDecCmp(ref d1, ref d2)); }
// Constructs a Decimal from a double value. // public Decimal(double value) { DecCalc.VarDecFromR8(value, out this); }
// Constructs a Decimal from a float value. // public Decimal(float value) { DecCalc.VarDecFromR4(value, out this); }
public static bool operator >=(Decimal d1, Decimal d2) { return(DecCalc.VarDecCmp(ref d1, ref d2) >= 0); }
// Truncates a Decimal to an integer value. The Decimal argument is rounded // towards zero to the nearest integer value, corresponding to removing all // digits after the decimal point. // public static Decimal Truncate(Decimal d) { DecCalc.VarDecFix(ref d); return(d); }
public bool Equals(Decimal value) { return(DecCalc.VarDecCmp(ref this, ref value) == 0); }
public Decimal(float value) { DecCalc.VarDecFromR4(value, out AsMutable(ref this)); }
// Compares two Decimal values for equality. Returns true if the two // Decimal values are equal, or false if they are not equal. // public static bool Equals(Decimal d1, Decimal d2) { return(DecCalc.VarDecCmp(ref d1, ref d2) == 0); }
public static long ToOACurrency(decimal value) { return(DecCalc.VarCyFromDec(ref AsMutable(ref value))); }
internal static uint DecDivMod1E9(ref decimal value) { return(DecCalc.DecDivMod1E9(ref AsMutable(ref value))); }