예제 #1
0
        public DecimalValue(double value_Renamed)
        {
            if (value_Renamed == 0.0)
            {
                exponent = 0;
                mantissa = 0;

                return;
            }

            var  decimalValue = (Decimal)(value_Renamed);
            int  exp          = SupportClass.BigDecimal_Scale(decimalValue);
            long mant         = SupportClass.BigDecimal_UnScaledValue(decimalValue);

            while (((mant % 10) == 0) && (mant != 0))
            {
                mant /= 10;
                exp  -= 1;
            }

            mantissa = mant;
            exponent = -exp;
        }
예제 #2
0
 public DecimalValue(Decimal bigDecimal)
 {
     mantissa = SupportClass.BigDecimal_UnScaledValue(bigDecimal);
     exponent = SupportClass.BigDecimal_Scale(bigDecimal);
 }