コード例 #1
0
 public static BigDecimal /*!*/ CreateBigDecimal(RubyContext /*!*/ context, RubyClass /*!*/ self, [DefaultProtocol] MutableString /*!*/ value, [Optional] int n)
 {
     return(BigDecimal.Create(GetConfig(context), value.ConvertToString(), 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));
 }
コード例 #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));
 }
コード例 #4
0
 public static RubyArray /*!*/ DivMod(RubyContext /*!*/ context, BigDecimal /*!*/ self, [NotNull] BigInteger /*!*/ other)
 {
     return(DivMod(context, self, BigDecimal.Create(GetConfig(context), other)));
 }
コード例 #5
0
 public BigDecimal ToBigDecimal()
 {
     return(_bipart == null?BigDecimal.Create(_lpart) : BigDecimal.Create(_bipart));
 }
コード例 #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)));
 }
コード例 #7
0
 public static BigDecimal /*!*/ Modulo(RubyContext /*!*/ context, BigDecimal /*!*/ self, int other)
 {
     return(Modulo(context, self, BigDecimal.Create(GetConfig(context), other)));
 }
コード例 #8
0
ファイル: NumericTest.cs プロジェクト: digital-asset/daml-net
 public void CanConvertBetweenProto()
 {
     ConvertThroughProto(new Numeric(BigDecimal.Create("123456.789")));
     ConvertThroughProto(new Numeric(BigDecimal.Create(LargeInt)));
     ConvertThroughProto(new Numeric(BigDecimal.Create(LargeDecimal)));
 }
コード例 #9
0
 public static Numeric FromProto(string number) => new Numeric(BigDecimal.Create(number));
コード例 #10
0
ファイル: BigDecimalOps.cs プロジェクト: gaybro8777/ironruby
 public static BigDecimal InducedFrom(RubyContext /*!*/ context, RubyClass /*!*/ self, int value)
 {
     return(BigDecimal.Create(GetConfig(context), value.ToString()));
 }
コード例 #11
0
ファイル: BigDecimalOps.cs プロジェクト: gaybro8777/ironruby
 public static RubyArray /*!*/ Coerce(RubyContext /*!*/ context, BigDecimal /*!*/ self, int other)
 {
     return(RubyOps.MakeArray2(BigDecimal.Create(GetConfig(context), other.ToString()), self));
 }
コード例 #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));
 }
コード例 #13
0
ファイル: BigDecimalOps.cs プロジェクト: ltwlf/IronSP
 public static object LessThan(RubyContext /*!*/ context, BigDecimal /*!*/ self, [NotNull] BigInteger /*!*/ other)
 {
     return(LessThenResult(self.CompareBigDecimal(BigDecimal.Create(GetConfig(context), other))));
 }
コード例 #14
0
ファイル: BigDecimalOps.cs プロジェクト: ltwlf/IronSP
 public static object GreaterThan(RubyContext /*!*/ context, BigDecimal /*!*/ self, double other)
 {
     return(GreaterThenResult(self.CompareBigDecimal(BigDecimal.Create(GetConfig(context), other))));
 }
コード例 #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)));
 }
コード例 #16
0
 public static object LessThanOrEqual(RubyContext /*!*/ context, BigDecimal /*!*/ self, double other)
 {
     return(LessThanOrEqualResult(self.CompareBigDecimal(BigDecimal.Create(GetConfig(context), other))));
 }
コード例 #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));
 }
コード例 #18
0
 public static bool Equal(RubyContext /*!*/ context, BigDecimal /*!*/ self, [NotNull] BigInteger /*!*/ other)
 {
     return(self.Equals(BigDecimal.Create(GetConfig(context), other)));
 }
コード例 #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));
 }
コード例 #20
0
 public static bool Equal(RubyContext /*!*/ context, BigDecimal /*!*/ self, double other)
 {
     return(self.Equals(BigDecimal.Create(GetConfig(context), other)));
 }
コード例 #21
0
 public static BigDecimal /*!*/ Modulo(RubyContext /*!*/ context, BigDecimal /*!*/ self, [NotNull] BigInteger /*!*/ other)
 {
     return(Modulo(context, self, BigDecimal.Create(GetConfig(context), other)));
 }
コード例 #22
0
 public static BigDecimal InducedFrom(RubyContext /*!*/ context, RubyClass /*!*/ self, [NotNull] BigInteger /*!*/ value)
 {
     return(BigDecimal.Create(GetConfig(context), value.ToString(CultureInfo.InvariantCulture)));
 }
コード例 #23
0
 public static object Compare(RubyContext /*!*/ context, BigDecimal /*!*/ self, int other)
 {
     return(self.CompareBigDecimal(BigDecimal.Create(GetConfig(context), other)));
 }
コード例 #24
0
 public Number(object initialValue)
 {
     value = BigDecimal.Create(new BigDecimal.Config(), initialValue.ToString());
 }