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

ruby-changes:18468

From: akr <ko1@a...>
Date: Sat, 8 Jan 2011 19:51:24 +0900 (JST)
Subject: [ruby-changes:18468] Ruby:r30491 (trunk): update doc.

akr	2011-01-08 19:51:14 +0900 (Sat, 08 Jan 2011)

  New Revision: 30491

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

  Log:
    update doc.

  Modified files:
    trunk/complex.c

Index: complex.c
===================================================================
--- complex.c	(revision 30490)
+++ complex.c	(revision 30491)
@@ -576,6 +576,11 @@
  *    Complex.polar(abs[, arg])  ->  complex
  *
  * Returns a complex object which denotes the given polar form.
+ *
+ *   Complex.polar(3, 0)           #=> (3.0+0.0i)
+ *   Complex.polar(3, Math::PI/2)  #=> (1.836909530733566e-16+3.0i)
+ *   Complex.polar(3, Math::PI)    #=> (-3.0+3.673819061467132e-16i)
+ *   Complex.polar(3, -Math::PI/2) #=> (1.836909530733566e-16-3.0i)
  */
 static VALUE
 nucomp_s_polar(int argc, VALUE *argv, VALUE klass)
@@ -985,6 +990,9 @@
  *    cmp.phase  ->  float
  *
  * Returns the angle part of its polar form.
+ *
+ *   Complex.polar(3, Math::PI/2).arg #=> 1.5707963267948966
+ *
  */
 static VALUE
 nucomp_arg(VALUE self)

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

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