[前][次][番号順一覧][スレッド一覧]

ruby-changes:21920

From: drbrain <ko1@a...>
Date: Wed, 7 Dec 2011 10:59:10 +0900 (JST)
Subject: [ruby-changes:21920] drbrain:r33969 (trunk): * ext/bigdecimal/bigdecimal.c: Document +@, -@, hash, INFINITY, Nan.

drbrain	2011-12-07 10:58:59 +0900 (Wed, 07 Dec 2011)

  New Revision: 33969

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33969

  Log:
    * ext/bigdecimal/bigdecimal.c:  Document +@, -@, hash, INFINITY, Nan.
      Patch by Sylvain Daubert.  [Ruby 1.9 - Feature #5622]

  Modified files:
    trunk/ChangeLog
    trunk/ext/bigdecimal/bigdecimal.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33968)
+++ ChangeLog	(revision 33969)
@@ -1,3 +1,8 @@
+Wed Dec  7 09:58:15 2011  Eric Hodel  <drbrain@s...>
+
+	* ext/bigdecimal/bigdecimal.c:  Document +@, -@, hash, INFINITY, Nan.
+	  Patch by Sylvain Daubert.  [Ruby 1.9 - Feature #5622]
+
 Wed Dec  7 09:48:00 2011  Eric Hodel  <drbrain@s...>
 
 	* io.c (Init_IO):  Mention io/console methods.  [Ruby 1.9 - Bug #5602]
Index: ext/bigdecimal/bigdecimal.c
===================================================================
--- ext/bigdecimal/bigdecimal.c	(revision 33968)
+++ ext/bigdecimal/bigdecimal.c	(revision 33969)
@@ -312,6 +312,12 @@
     return obj;
 }
 
+/*
+ * call-seq: hash
+ *
+ * Creates a hash for this BigDecimal.  Two BigDecimals with equal sign,
+ * fractional part and exponent have the same hash.
+ */
 static VALUE
 BigDecimal_hash(VALUE self)
 {
@@ -786,6 +792,14 @@
     return obj;
 }
 
+/*
+ * call-seq: +@
+ *
+ * Return self.
+ *
+ * e.g.
+ *   b = +a  # b == a
+ */
 static VALUE
 BigDecimal_uplus(VALUE self)
 {
@@ -1052,6 +1066,14 @@
     return BigDecimalCmp(self, r, 'G');
 }
 
+/*
+ * call-seq: -@
+ *
+ * Return the negation of self.
+ *
+ * e.g.
+ *   b = -a # b == a * -1
+ */
 static VALUE
 BigDecimal_neg(VALUE self)
 {
@@ -2929,8 +2951,10 @@
     rb_define_const(rb_cBigDecimal, "SIGN_NEGATIVE_INFINITE",INT2FIX(VP_SIGN_NEGATIVE_INFINITE));
 
     arg = rb_str_new2("+Infinity");
+    /* Positive infinity value. */
     rb_define_const(rb_cBigDecimal, "INFINITY", BigDecimal_global_new(1, &arg, rb_cBigDecimal));
     arg = rb_str_new2("NaN");
+    /* 'Not a Number' value. */
     rb_define_const(rb_cBigDecimal, "NAN", BigDecimal_global_new(1, &arg, rb_cBigDecimal));
 
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]