55件ヒット
[1-55件を表示]
(0.054秒)
クラス
- Complex (11)
- NilClass (11)
- Numeric (11)
- String (11)
- UnboundMethod (11)
検索結果
先頭5件
-
String
# to _ c -> Complex (18194.0) -
自身を複素数 (Complex) に変換した結果を返します。
...uby]{
'9'.to_c # => (9+0i)
'2.5'.to_c # => (2.5+0i)
'2.5/1'.to_c # => ((5/2)+0i)
'-3/2'.to_c # => ((-3/2)+0i)
'-i'.to_c # => (0-1i)
'45i'.to_c # => (0+45i)
'3-4i'.to_c # => (3-4i)
'-4e2-4e-2i'.to_c # => (-400.0-0.04i)
'-0.0-0.0i'.to_c # => (-......0.0-0.0i)
'1/2+3/4i'.to_c # => ((1/2)+(3/4)*i)
'10@10'.to_c # => (-8.390715290764524-5.440211108893697i)
'-0.3_3'.to_c # => (-0.33+0i)
" \t\r\n5+3i".to_c # => (5+3i)
'5+3ix'.to_c # => (5+3i)
'ruby'.to_c # => (0+0i)
//}... -
Numeric
# to _ c -> Complex (18128.0) -
自身を複素数 (Complex) に変換します。Complex(self, 0) を返します。
...(Complex) に変換します。Complex(self, 0) を返します。
//emlist[例][ruby]{
1.to_c # => (1+0i)
-1.to_c # => (-1+0i)
1.0.to_c # => (1.0+0i)
Rational(1, 2).to_c # => ((1/2)+0i)
//}
Numeric のサブクラスは、このメソッドを適切に再定... -
Complex
# to _ c -> self (18116.0) -
self を返します。
...self を返します。
//emlist[例][ruby]{
Complex(2).to_c # => (2+0i)
Complex(-8, 6).to_c # => (-8+6i)
//}... -
NilClass
# to _ c -> Complex (18110.0) -
0+0i を返します。
...0+0i を返します。
//emlist[例][ruby]{
nil.to_c # => (0+0i)
//}... -
UnboundMethod
# owner -> Class | Module (9.0) -
このメソッドが定義されている class か module を返します。
...このメソッドが定義されている class か module を返します。
//emlist[例][ruby]{
Integer.instance_method(:to_s).owner # => Integer
Integer.instance_method(:to_c).owner # => Numeric
Integer.instance_method(:hash).owner # => Kernel
//}...