Inheritance: Number, System.IComparable
Example #1
0
 //////////////////////////////////////////////////////////////////////////
 // Identity
 //////////////////////////////////////////////////////////////////////////
 public static bool equals(BigDecimal self, object obj)
 {
     if (obj is BigDecimal)
       {
     return self.Equals(obj);
       }
       return false;
 }
Example #2
0
 public static BigDecimal mod(BigDecimal self, BigDecimal x)
 {
     return self.remainder(x);
 }
Example #3
0
 public static BigDecimal div(BigDecimal self, BigDecimal x)
 {
     return(self.divide(x));
 }
Example #4
0
 public static BigDecimal div(BigDecimal self, BigDecimal x)
 {
     return self.divide(x);
 }
Example #5
0
 public static string toCode(BigDecimal self)
 {
     return self.ToString() + "d";
 }
Example #6
0
 public static Type type(BigDecimal self)
 {
     return Sys.DecimalType;
 }
Example #7
0
 public static BigDecimal plus(BigDecimal self, BigDecimal x)
 {
     return(self.add(x));
 }
Example #8
0
 //////////////////////////////////////////////////////////////////////////
 // Operators
 //////////////////////////////////////////////////////////////////////////
 public static BigDecimal negate(BigDecimal self)
 {
     return BigDecimal.valueOf(-self.decimalValue());
 }
Example #9
0
 public static BigDecimal modInt(BigDecimal self, long x)
 {
     return(self.remainder(BigDecimal.valueOf(x)));
 }
Example #10
0
 public static BigDecimal modFloat(BigDecimal self, double x)
 {
     return(self.remainder(BigDecimal.valueOf(x)));
 }
Example #11
0
 public static BigDecimal mod(BigDecimal self, BigDecimal x)
 {
     return(self.remainder(x));
 }
Example #12
0
 public static BigDecimal divFloat(BigDecimal self, double x)
 {
     return(self.divide(BigDecimal.valueOf(x)));
 }
Example #13
0
 public static BigDecimal divInt(BigDecimal self, long x)
 {
     return(self.divide(BigDecimal.valueOf(x)));
 }
Example #14
0
 public static BigDecimal modInt(BigDecimal self, long x)
 {
     return self.remainder(BigDecimal.valueOf(x));
 }
Example #15
0
 public static BigDecimal plusInt(BigDecimal self, long x)
 {
     return(self.add(BigDecimal.valueOf(x)));
 }
Example #16
0
 public static BigDecimal multFloat(BigDecimal self, double x)
 {
     return self.multiply(BigDecimal.valueOf(x));
 }
Example #17
0
 public static BigDecimal plusFloat(BigDecimal self, double x)
 {
     return(self.add(BigDecimal.valueOf(x)));
 }
Example #18
0
 public static BigDecimal plusFloat(BigDecimal self, double x)
 {
     return self.add(BigDecimal.valueOf(x));
 }
Example #19
0
 public static BigDecimal minus(BigDecimal self, BigDecimal x)
 {
     return(self.subtract(x));
 }
Example #20
0
        public static string toLocale(BigDecimal self, string pattern)
        {
            // get current locale
              Locale locale = Locale.cur();
              NumberFormatInfo df = locale.dec();

              // get default pattern if necessary
              if (pattern == null)
            pattern = Env.cur().locale(Sys.m_sysPod, "decimal", "#,###.0##");

              // parse pattern and get digits
              NumPattern p = NumPattern.parse(pattern);
              NumDigits d = new NumDigits(self);

              // route to common FanNum method
              return FanNum.toLocale(p, d, df);
        }
Example #21
0
 public static BigDecimal minusInt(BigDecimal self, long x)
 {
     return(self.subtract(BigDecimal.valueOf(x)));
 }
Example #22
0
 public static long compare(BigDecimal self, object obj)
 {
     return self.CompareTo(obj);
 }
Example #23
0
 public static BigDecimal minusFloat(BigDecimal self, double x)
 {
     return(self.subtract(BigDecimal.valueOf(x)));
 }
Example #24
0
 public static BigDecimal divInt(BigDecimal self, long x)
 {
     return self.divide(BigDecimal.valueOf(x));
 }
Example #25
0
        //////////////////////////////////////////////////////////////////////////
        // Math
        //////////////////////////////////////////////////////////////////////////

        public static BigDecimal abs(BigDecimal self)
        {
            return((self.decimalValue() >= 0) ? self : BigDecimal.valueOf(-self.decimalValue()));
        }
Example #26
0
        internal int size; // size of digits used

        #endregion Fields

        #region Constructors

        internal NumDigits(BigDecimal d)
            : this(d.ToString())
        {
        }
Example #27
0
        //////////////////////////////////////////////////////////////////////////
        // Conversion
        //////////////////////////////////////////////////////////////////////////

        public static string toStr(BigDecimal self)
        {
            return(self.ToString());
        }
Example #28
0
 public static BigDecimal minusInt(BigDecimal self, long x)
 {
     return self.subtract(BigDecimal.valueOf(x));
 }
Example #29
0
 public static void encode(BigDecimal self, ObjEncoder @out)
 {
     @out.w(self.ToString()).w("d");
 }
Example #30
0
 public static BigDecimal modFloat(BigDecimal self, double x)
 {
     return self.remainder(BigDecimal.valueOf(x));
 }
Example #31
0
 public static string toCode(BigDecimal self)
 {
     return(self.ToString() + "d");
 }
Example #32
0
 public static BigDecimal mult(BigDecimal self, BigDecimal x)
 {
     return self.multiply(x);
 }
Example #33
0
 public static string toLocale(BigDecimal self)
 {
     return(toLocale(self, null));
 }
Example #34
0
 public static BigDecimal multInt(BigDecimal self, long x)
 {
     return self.multiply(BigDecimal.valueOf(x));
 }
Example #35
0
 public static long compare(BigDecimal self, object obj)
 {
     return(self.CompareTo(obj));
 }
Example #36
0
 public static BigDecimal plus(BigDecimal self, BigDecimal x)
 {
     return self.add(x);
 }
Example #37
0
 public static long hash(BigDecimal self)
 {
     return(self.GetHashCode());
 }
Example #38
0
 public static BigDecimal plusInt(BigDecimal self, long x)
 {
     return self.add(BigDecimal.valueOf(x));
 }
Example #39
0
 public static Type type(BigDecimal self)
 {
     return(Sys.DecimalType);
 }
Example #40
0
 public static string toLocale(BigDecimal self)
 {
     return toLocale(self, null);
 }
Example #41
0
        //////////////////////////////////////////////////////////////////////////
        // Operators
        //////////////////////////////////////////////////////////////////////////

        public static BigDecimal negate(BigDecimal self)
        {
            return(BigDecimal.valueOf(-self.decimalValue()));
        }
Example #42
0
 //////////////////////////////////////////////////////////////////////////
 // Conversion
 //////////////////////////////////////////////////////////////////////////
 public static string toStr(BigDecimal self)
 {
     return self.ToString();
 }
Example #43
0
 public static BigDecimal decrement(BigDecimal self)
 {
     return(BigDecimal.valueOf(self.decimalValue() - 1));
 }
Example #44
0
 //////////////////////////////////////////////////////////////////////////
 // Math
 //////////////////////////////////////////////////////////////////////////
 public static BigDecimal abs(BigDecimal self)
 {
     return (self.decimalValue() >= 0) ? self : BigDecimal.valueOf(-self.decimalValue());
 }
Example #45
0
 public static BigDecimal mult(BigDecimal self, BigDecimal x)
 {
     return(self.multiply(x));
 }
Example #46
0
 public static BigDecimal decrement(BigDecimal self)
 {
     return BigDecimal.valueOf(self.decimalValue()-1);
 }
Example #47
0
 public static BigDecimal multInt(BigDecimal self, long x)
 {
     return(self.multiply(BigDecimal.valueOf(x)));
 }
Example #48
0
 public static BigDecimal divFloat(BigDecimal self, double x)
 {
     return self.divide(BigDecimal.valueOf(x));
 }
Example #49
0
 public static BigDecimal min(BigDecimal self, BigDecimal that)
 {
     if (self.CompareTo(that) <= 0) return self;
       return that;
 }
Example #50
0
 public static void encode(BigDecimal self, ObjEncoder @out)
 {
     @out.w(self.ToString()).w("d");
 }
Example #51
0
 public static BigDecimal minus(BigDecimal self, BigDecimal x)
 {
     return self.subtract(x);
 }
Example #52
0
 public virtual OutStream writeDecimal(BigDecimal x)
 {
     return writeUtfString(x.ToString());
 }
Example #53
0
 public static BigDecimal minusFloat(BigDecimal self, double x)
 {
     return self.subtract(BigDecimal.valueOf(x));
 }
Example #54
0
File: Buf.cs Project: nomit007/f4
 public Buf writeDecimal(BigDecimal x)
 {
     m_out.writeDecimal(x); return this;
 }
Example #55
0
 public static BigDecimal multFloat(BigDecimal self, double x)
 {
     return(self.multiply(BigDecimal.valueOf(x)));
 }