summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-08 00:34:55 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-08 00:34:55 +0000
commit6ea34efab04f08c4bb772af8406e09021a403bc0 (patch)
treea5b7ea8854b644cbfb3d9861535646a647e87021 /numeric.c
parenta68cc24a9e8ad3c1ce2b9ce4b13d2b5849ec1fd9 (diff)
* numeric.c: Add description of that the results of the comparing
operations of two NaNs are undefined. [#1720] [ruby-dev:38725] [ruby-core:36966] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/numeric.c b/numeric.c
index aab049490d..278d27f489 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1042,6 +1042,8 @@ num_equal(VALUE x, VALUE y)
* Returns <code>true</code> only if <i>obj</i> has the same value
* as <i>flt</i>. Contrast this with <code>Float#eql?</code>, which
* requires <i>obj</i> to be a <code>Float</code>.
+ * The result of <code>NaN == NaN</code> is undefined, so the
+ * implementation-dependent value is returned.
*
* 1.0 == 1 #=> true
*
@@ -1109,6 +1111,8 @@ rb_dbl_cmp(double a, double b)
* 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.
*/
static VALUE
@@ -1153,6 +1157,8 @@ flo_cmp(VALUE x, VALUE y)
* flt > real -> true or false
*
* <code>true</code> if <code>flt</code> is greater than <code>real</code>.
+ * The result of <code>NaN > NaN</code> is undefined, so the
+ * implementation-dependent value is returned.
*/
static VALUE
@@ -1193,6 +1199,8 @@ flo_gt(VALUE x, VALUE y)
*
* <code>true</code> if <code>flt</code> is greater than
* or equal to <code>real</code>.
+ * The result of <code>NaN >= NaN</code> is undefined, so the
+ * implementation-dependent value is returned.
*/
static VALUE
@@ -1232,6 +1240,8 @@ flo_ge(VALUE x, VALUE y)
* flt < real -> true or false
*
* <code>true</code> if <code>flt</code> is less than <code>real</code>.
+ * The result of <code>NaN < NaN</code> is undefined, so the
+ * implementation-dependent value is returned.
*/
static VALUE
@@ -1272,6 +1282,8 @@ flo_lt(VALUE x, VALUE y)
*
* <code>true</code> if <code>flt</code> is less than
* or equal to <code>real</code>.
+ * The result of <code>NaN <= NaN</code> is undefined, so the
+ * implementation-dependent value is returned.
*/
static VALUE
@@ -1313,6 +1325,8 @@ flo_le(VALUE x, VALUE y)
* Returns <code>true</code> only if <i>obj</i> is a
* <code>Float</code> with the same value as <i>flt</i>. Contrast this
* with <code>Float#==</code>, which performs type conversions.
+ * The result of <code>NaN.eql?(NaN)</code> is undefined, so the
+ * implementation-dependent value is returned.
*
* 1.0.eql?(1) #=> false
*/