summaryrefslogtreecommitdiff
path: root/ext/bigdecimal/bigdecimal.c
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-31 22:36:16 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-31 22:36:16 +0000
commitbf3d294ae83c94dd524d965bcfd25a8192ec851d (patch)
tree678f2a195ffcb93b01a385edd811d48e7263e9b8 /ext/bigdecimal/bigdecimal.c
parent9437332afd78227ed968594c704b08d770c60451 (diff)
* ext/bigdecimal/bigdecimal.c: [DOC] Add description of
`BigDecimal.new` exceptions. Patched by @joker1007 and @prathamesh-sonpatki [Fixes GH-690] https://github.com/ruby/ruby/pull/690 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal/bigdecimal.c')
-rw-r--r--ext/bigdecimal/bigdecimal.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index 44e13a4..08febb5 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -2463,6 +2463,19 @@ static Real *BigDecimal_new(int argc, VALUE *argv);
*
* The actual number of significant digits used in computation is usually
* larger than the specified number.
+ *
+ * ==== Exceptions
+ *
+ * TypeError:: If the +initial+ type is neither Fixnum, Bignum, Float,
+ * Rational, nor BigDecimal, this exception is raised.
+ *
+ * TypeError:: If the +digits+ is not a Fixnum, this exception is raised.
+ *
+ * ArgumentError:: If +initial+ is a Float, and the +digits+ is larger than
+ * Float::DIG + 1, this exception is raised.
+ *
+ * ArgumentError:: If the +initial+ is a Float or Rational, and the +digits+
+ * value is omitted, this exception is raised.
*/
static VALUE
BigDecimal_initialize(int argc, VALUE *argv, VALUE self)