From fecc53f0ecbcc514a63d7f3eba3ee0342bbe870d Mon Sep 17 00:00:00 2001 From: marcandre Date: Sat, 8 May 2010 04:58:32 +0000 Subject: * error.c: RDoc for subclasses of Exception. [ruby-core:28394] * cont.c: ditto * enumerator.c: ditto * io.c: ditto * math.c: ditto * numeric.c: ditto * proc.c: ditto * re.c: ditto * thread.c: ditto * transcode.c: ditto. Thanks to Run Paint for some of the documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@27673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index fc05c9963c..f2c8c13a97 100644 --- a/numeric.c +++ b/numeric.c @@ -3198,6 +3198,38 @@ fix_even_p(VALUE num) return Qtrue; } +/* + * Document-class: ZeroDivisionError + * + * Raised when attempting to divide an integer by 0. + * + * 42 / 0 + * + * raises the exception: + * + * ZeroDivisionError: divided by 0 + * + * Note that only division by an exact 0 will raise that exception: + * + * 42 / 0.0 # => Float::INFINITY + * 42 / -0.0 # => -Float::INFINITY + * 0 / 0.0 # => NaN + */ + +/* + * Document-class: FloatDomainError + * + * Raised when attempting to convert special float values + * (in particular infinite or NaN) + * to numerical classes which don't support them. + * + * Float::INFINITY.to_r + * + * raises the exception: + * + * FloatDomainError: Infinity + */ + void Init_Numeric(void) { -- cgit v1.2.3