From b85ed255fafe48e3d435eee31d6403af5558afb9 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 8 Jan 2011 10:51:14 +0000 Subject: [PATCH] update doc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- complex.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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)