1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

bigdecimal/math.rb: error message in BigMath#PI

* ext/bigdecimal/lib/bigdecimal/math.rb (BigMath#PI): change error
  message about zero or negative precision for clarity and
  consistency with other methods.  [GH-644]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-06-28 11:29:11 +00:00
parent 8b76d21f55
commit 38f013391d
2 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,9 @@
Sat Jun 28 20:29:03 2014 Simon Baird <simon.baird@gmail.com>
* ext/bigdecimal/lib/bigdecimal/math.rb (BigMath#PI): change error
message about zero or negative precision for clarity and
consistency with other methods. [GH-644]
Sat Jun 28 15:32:57 2014 Tanaka Akira <akr@fsij.org>
* lib/webrick/utils.rb (create_listeners): Close socket objects.

View file

@ -180,7 +180,7 @@ module BigMath
# #=> "0.3141592653589793238462643388813853786957412E1"
#
def PI(prec)
raise ArgumentError, "Zero or negative argument for PI" if prec <= 0
raise ArgumentError, "Zero or negative precision for PI" if prec <= 0
n = prec + BigDecimal.double_fig
zero = BigDecimal("0")
one = BigDecimal("1")