Esempio n. 1
0
 public static BigDecimal /*!*/ CreateBigDecimal(RubyContext /*!*/ context, RubyClass /*!*/ self, [DefaultProtocol] MutableString /*!*/ value, [Optional] int n)
 {
     return(BigDecimal.Create(GetConfig(context), value.ConvertToString(), n));
 }
Esempio n. 2
0
 public static RubyArray /*!*/ Coerce(RubyContext /*!*/ context, BigDecimal /*!*/ self, BigInteger /*!*/ other)
 {
     return(RubyOps.MakeArray2(BigDecimal.Create(GetConfig(context), other.ToString(CultureInfo.InvariantCulture)), self));
 }
Esempio n. 3
0
 public static BigDecimal /*!*/ Add(RubyContext /*!*/ context, BigDecimal /*!*/ self, int other, int n)
 {
     BigDecimal.Config config = GetConfig(context);
     return(BigDecimal.Add(config, self, BigDecimal.Create(config, other), n));
 }
Esempio n. 4
0
 public static RubyArray /*!*/ DivMod(RubyContext /*!*/ context, BigDecimal /*!*/ self, [NotNull] BigInteger /*!*/ other)
 {
     return(DivMod(context, self, BigDecimal.Create(GetConfig(context), other)));
 }
Esempio n. 5
0
 public BigDecimal ToBigDecimal()
 {
     return(_bipart == null?BigDecimal.Create(_lpart) : BigDecimal.Create(_bipart));
 }
Esempio n. 6
0
 public static BigDecimal /*!*/ Multiply(RubyContext /*!*/ context, BigDecimal /*!*/ self, [NotNull] BigInteger /*!*/ other)
 {
     BigDecimal.Config config = GetConfig(context);
     return(BigDecimal.Multiply(config, self, BigDecimal.Create(config, other)));
 }
Esempio n. 7
0
 public static BigDecimal /*!*/ Modulo(RubyContext /*!*/ context, BigDecimal /*!*/ self, int other)
 {
     return(Modulo(context, self, BigDecimal.Create(GetConfig(context), other)));
 }
Esempio n. 8
0
 public void CanConvertBetweenProto()
 {
     ConvertThroughProto(new Numeric(BigDecimal.Create("123456.789")));
     ConvertThroughProto(new Numeric(BigDecimal.Create(LargeInt)));
     ConvertThroughProto(new Numeric(BigDecimal.Create(LargeDecimal)));
 }
Esempio n. 9
0
 public static Numeric FromProto(string number) => new Numeric(BigDecimal.Create(number));
Esempio n. 10
0
 public static BigDecimal InducedFrom(RubyContext /*!*/ context, RubyClass /*!*/ self, int value)
 {
     return(BigDecimal.Create(GetConfig(context), value.ToString()));
 }
Esempio n. 11
0
 public static RubyArray /*!*/ Coerce(RubyContext /*!*/ context, BigDecimal /*!*/ self, int other)
 {
     return(RubyOps.MakeArray2(BigDecimal.Create(GetConfig(context), other.ToString()), self));
 }
Esempio n. 12
0
 public static object CreateBigDecimal(RubyContext /*!*/ context, object /*!*/ self, [DefaultProtocol] MutableString value, [Optional] int n)
 {
     return(BigDecimal.Create(BigDecimalOps.GetConfig(context), value.ConvertToString(), n));
 }
Esempio n. 13
0
 public static object LessThan(RubyContext /*!*/ context, BigDecimal /*!*/ self, [NotNull] BigInteger /*!*/ other)
 {
     return(LessThenResult(self.CompareBigDecimal(BigDecimal.Create(GetConfig(context), other))));
 }
Esempio n. 14
0
 public static object GreaterThan(RubyContext /*!*/ context, BigDecimal /*!*/ self, double other)
 {
     return(GreaterThenResult(self.CompareBigDecimal(BigDecimal.Create(GetConfig(context), other))));
 }
Esempio n. 15
0
 public static BigDecimal /*!*/ Subtract(RubyContext /*!*/ context, BigDecimal /*!*/ self, int other)
 {
     BigDecimal.Config config = GetConfig(context);
     return(BigDecimal.Subtract(config, self, BigDecimal.Create(config, other)));
 }
Esempio n. 16
0
 public static object LessThanOrEqual(RubyContext /*!*/ context, BigDecimal /*!*/ self, double other)
 {
     return(LessThanOrEqualResult(self.CompareBigDecimal(BigDecimal.Create(GetConfig(context), other))));
 }
Esempio n. 17
0
 public static BigDecimal /*!*/ Subtract(RubyContext /*!*/ context, BigDecimal /*!*/ self, [NotNull] BigInteger /*!*/ other, int n)
 {
     BigDecimal.Config config = GetConfig(context);
     return(BigDecimal.Subtract(config, self, BigDecimal.Create(config, other), n));
 }
Esempio n. 18
0
 public static bool Equal(RubyContext /*!*/ context, BigDecimal /*!*/ self, [NotNull] BigInteger /*!*/ other)
 {
     return(self.Equals(BigDecimal.Create(GetConfig(context), other)));
 }
Esempio n. 19
0
 public static BigDecimal /*!*/ Multiply(RubyContext /*!*/ context, BigDecimal /*!*/ self, double other, int n)
 {
     BigDecimal.Config config = GetConfig(context);
     return(BigDecimal.Multiply(config, self, BigDecimal.Create(config, other), n));
 }
Esempio n. 20
0
 public static bool Equal(RubyContext /*!*/ context, BigDecimal /*!*/ self, double other)
 {
     return(self.Equals(BigDecimal.Create(GetConfig(context), other)));
 }
Esempio n. 21
0
 public static BigDecimal /*!*/ Modulo(RubyContext /*!*/ context, BigDecimal /*!*/ self, [NotNull] BigInteger /*!*/ other)
 {
     return(Modulo(context, self, BigDecimal.Create(GetConfig(context), other)));
 }
Esempio n. 22
0
 public static BigDecimal InducedFrom(RubyContext /*!*/ context, RubyClass /*!*/ self, [NotNull] BigInteger /*!*/ value)
 {
     return(BigDecimal.Create(GetConfig(context), value.ToString(CultureInfo.InvariantCulture)));
 }
Esempio n. 23
0
 public static object Compare(RubyContext /*!*/ context, BigDecimal /*!*/ self, int other)
 {
     return(self.CompareBigDecimal(BigDecimal.Create(GetConfig(context), other)));
 }
Esempio n. 24
0
 public Number(object initialValue)
 {
     value = BigDecimal.Create(new BigDecimal.Config(), initialValue.ToString());
 }