summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-23 03:35:38 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-23 03:35:38 +0000
commitc2204ca328817f3d87232471a4e1de0334425752 (patch)
treeb5489d0f829a520280292240aba2dc834f99af4f /numeric.c
parent827e71bda54ffab6e2b2e0434b235c6190055cdb (diff)
* array.c: Document #<=> return values and formatting
* bignum.c: ditto * file.c: ditto * object.c: ditto * numeric.c: ditto * rational.c: ditto * string.c: ditto * time.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/numeric.c b/numeric.c
index 5c629d79c9..fe85d6cc31 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1038,10 +1038,10 @@ num_eql(VALUE x, VALUE y)
/*
* call-seq:
- * num <=> other -> 0 or nil
+ * number <=> other -> 0 or nil
*
- * Returns zero if <i>num</i> equals <i>other</i>, <code>nil</code>
- * otherwise.
+ * Returns zero if +number+ equals +other+, otherwise +nil+ is returned if the
+ * two values are incomparable.
*/
static VALUE
@@ -1129,13 +1129,15 @@ rb_dbl_cmp(double a, double b)
/*
* call-seq:
- * flt <=> real -> -1, 0, +1 or nil
+ * float <=> real -> -1, 0, +1 or nil
+ *
+ * Returns -1, 0, +1 or nil depending on whether +float+ is less than, equal
+ * to, or greater than +real+. This is the basis for the tests in Comparable.
*
- * Returns -1, 0, +1 or nil depending on whether <i>flt</i> is less
- * than, equal to, or greater than <i>real</i>. This is the basis for
- * the tests in <code>Comparable</code>.
* The result of <code>NaN <=> NaN</code> is undefined, so the
* implementation-dependent value is returned.
+ *
+ * +nil+ is returned if the two values are incomparable.
*/
static VALUE
@@ -3042,10 +3044,11 @@ fix_equal(VALUE x, VALUE y)
* call-seq:
* fix <=> numeric -> -1, 0, +1 or nil
*
- * Comparison---Returns -1, 0, +1 or nil depending on whether
- * <i>fix</i> is less than, equal to, or greater than
- * <i>numeric</i>. This is the basis for the tests in
- * <code>Comparable</code>.
+ * Comparison---Returns -1, 0, +1 or nil depending on whether +fix+ is less
+ * than, equal to, or greater than +numeric+. This is the basis for the tests
+ * in Comparable.
+ *
+ * +nil+ is returned if the two values are incomparable.
*/
static VALUE