419件ヒット
[401-419件を表示]
(0.137秒)
ライブラリ
- ビルトイン (419)
キーワード
- % (12)
-
/ (12) - <=> (12)
- angle (12)
- arg (12)
- ceil (12)
- coerce (12)
- conjugate (12)
- denominator (12)
- div (12)
- divmod (12)
- eql? (12)
- fdiv (12)
- finite? (9)
- floor (12)
- infinite? (9)
- integer? (12)
- modulo (12)
- negative? (10)
- numerator (12)
- phase (12)
- positive? (10)
- quo (12)
- rect (12)
- rectangular (12)
- remainder (12)
- round (12)
- step (93)
- truncate (12)
検索結果
-
Numeric
# phase -> 0 | Math :: PI (108.0) -
自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。
...自身の偏角(正の数なら 0、負の数なら Math::PI)を返します。
//emlist[例][ruby]{
1.arg # => 0
-1.arg # => 3.141592653589793
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。
@see Complex#arg... -
Numeric
# round -> Integer (108.0) -
自身ともっとも近い整数を返します。
...0.5, -0.5 はそれぞれ 1,-1 に切り上げされます。いわゆる四捨五入ですが、偶数丸めではありません。
//emlist[例][ruby]{
1.round #=> 1
1.2.round #=> 1
(-1.2).round #=> -1
(-1.5).round #=> -2
//}
@see Numeric#ceil, Numeric#floor, Numeric#truncate...