summaryrefslogtreecommitdiff
path: root/complex.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-08 10:51:14 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-08 10:51:14 +0000
commitb85ed255fafe48e3d435eee31d6403af5558afb9 (patch)
treef1bda9441f3f4fea8eb06a53f6f85c003062e2a4 /complex.c
parentc36ad781ef177e1d3e44b662951dc6b399438e0d (diff)
update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'complex.c')
-rw-r--r--complex.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/complex.c b/complex.c
index 043906ef0a..69cb2d8aea 100644
--- a/complex.c
+++ b/complex.c
@@ -576,6 +576,11 @@ f_complex_polar(VALUE klass, VALUE x, VALUE y)
* 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 @@ nucomp_abs2(VALUE self)
* 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)