test/bigdecimal/test_bigdecimal.rb:
Fix exception message of BigDecimal constructor with a Float.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
test/bigdecimal/test_bigdecimal.rb:
need to specify precision for converting Rational and Float.
[ruby-core:48045] [Bug #7176]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
can be overridden, so should not make an assumption on the type
of results. [ruby-core:42969][Bug #6093]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
zero or negative precision is error. fixes#5098.
[ruby-dev:44210]
* test/bigdecimal/test_bigdecimal_util.rb: add test for the above
change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
specifying precision. fixes#5098. [ruby-dev:44210]
* test/bigdecimal/test_bigdecimal_util.rb: add test for the above
change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
for symmetry to BigDecimal() function with an Integer.
fixes#5098. [ruby-dev:44210]
* test/bigdecimal/test_bigdecimal_util.rb: add test for the above
change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
for adapting other Numeric subclasses. [ruby-dev:44245]
* test/bigdecimal/test_bigdecimal_util.rb: test for the above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
a BigDecimal.
* bigdecimal/bigdecimal.c (BigDecimal_new): support generating a new
BigDecimal from another BigDecimal using BigDecimal global function
or constructor. [ruby-dev:44245]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
precision treatment errors.
* test/bigdecimal/test_bigdecimal.rb: add tests for the above change.
fix precision treatment errors.
* ext/bigdecimal/bigdecimal.c (BigDecimal_power): precision argument
should be optional for its compatibility.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
for Float and Rational arguments.
* test/bigdecimal/test_bigdecimal.rb (test_new, test_cmp, test_power):
add and modify tests for the above change.
* ext/bigdecimal/bigdecimal.c (BigDecimalCmp): modify coding style to
match ruby's standard.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
a Float through Rational.
* ext/bigdecimal/bigdecimal.c (BigDecimal_new): ditto.
* test/bigdecimal/test_bigdecimal.rb (test_global_new_float): add a test for
the above changes.
* test/bigdecimal/test_bigdecimal.rb (test_new_with_float): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Rational. The precision used for instantiate a BigDecimal from the
given Rational is obtained from the receiver BigDecimal.
* test/bigdecimal/test_bigdecimal.rb (test_coerce): add a test for the
above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
coercing from a Rational to stop requiring "bigecimal/util.rb".
[ruby-core:34318]
* ext/bigdecimal/bigdecimal.c (GetVpValue): refactoring.
* ext/bigdecimal/bigdecimal.c (BigDecimal_new): support instantiation from a
Rational.
* test/bigdecimal/test_bigdecimal.rb (test_global_new_with_rationao): add a
test for the above change.
* test/bigdecimal/test_bigdecimal.rb (test_new_with_rationao): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
BigDecimal object from an Integer.
* test/bigdecimal/test_bigdecimal.rb (test_new_with_integer):
add for testing the above change.
* ext/bigdecimal/bigdecimal.c (BigDecimal_global_new): replace its body
with a BigDecimal_new call.
* test/bigdecimal/test_bigdecimal.rb (test_global_new_with_integer):
add for testing the above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
return the result of a block.
* test/bigdecimal/test_bigdecimal.rb (test_save_limit):
add a test for the above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
return the result of a block.
* test/bigdecimal/test_bigdecimal.rb (test_save_rounding_mode):
add a test for the above change.
* test/bigdecimal/test_bigdecimal.rb (test_save_exception_mode):
add a test for the return value of BigDecimal.save_exception_mode.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
converting symbol to rounding mode number.
* ext/bigdecimal/bigdecimal.c (BigDecimal_mode, BigDecimal_round):
support to specify rounding mode by symbol.
* test/bigdecimal/test_bigdecimal.rb (test_mode, test_round):
add tests for avobe changes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
and half-even. This change is based on the patch created by Matthew
Willson, the reporter of this bug. [Bug #3803] [ruby-core:32136]
* test/bigdecimal/test_bigdecimal.rb: add tests for above changes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/bigdecimal/test_bigdecimal.rb (test_to_f): added test for the above changes.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/bigdecimal/lib/bigdecimal/math.rb (BigMath.exp): modify the behaviors for infinity arguments as same as Math.exp.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
collected. based on a patch masaya tarui at [ruby-dev:41213].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
was Infinity, not 0.
* test/bigdecimal/test_bigdecimal.rb: add a test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
improved precision and performance. based on a patch from Makoto
Yamashita in [ruby-core:25600] and [ruby-core:25602].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e