44件ヒット
[1-44件を表示]
(0.069秒)
種類
- インスタンスメソッド (22)
- 特異メソッド (22)
キーワード
-
each
_ prime (22) - round (11)
- truncate (11)
検索結果
先頭5件
-
Integer
# round(ndigits = 0 , half: :up) -> Integer (6225.0) -
self ともっとも近い整数を返します。
...{
1.round # => 1
1.round(2) # => 1
15.round(-1) # => 20
(-15).round(-1) # => -20
25.round(-1, half: :up) # => 30
25.round(-1, half: :down) # => 20
25.round(-1, half: :even) # => 20
35.round(-1, half: :up) # => 40
35.round(-1, half: :down) # => 30
35.round(-1, hal......f: :even) # => 40
(-25).round(-1, half: :up) # => -30
(-25).round(-1, half: :down) # => -20
(-25).round(-1, half: :even) # => -20
//}
@see Numeric#round... -
Integer
# round(ndigits = 0 , half: :up) -> Integer | Float (6225.0) -
self ともっとも近い整数を返します。
...合、Float を返します。
小数点以下を、最大 n 桁にします。
負の整数を指定した場合、Integer を返します。
小数点位置から左に少なくとも n 個の 0 が並びます。
@param half ちょうど半分の値の......1.round # => 1
1.round(2) # => 1.0
15.round(-1) # => 20
(-15).round(-1) # => -20
25.round(-1, half: :up) # => 30
25.round(-1, half: :down) # => 20
25.round(-1, half: :even) # => 20
35.round(-1, half: :up) # => 40
35.round(-1, half: :down) # => 30
35.round(-1, ha......lf: :even) # => 40
(-25).round(-1, half: :up) # => -30
(-25).round(-1, half: :down) # => -20
(-25).round(-1, half: :even) # => -20
//}
@see Numeric#round... -
Integer
# truncate(ndigits = 0) -> Integer (6207.0) -
0 から self までの整数で、自身にもっとも近い整数を返します。
...します。
負の整数を指定した場合、小数点位置から左に少なくとも n 個の 0 が並びます。
//emlist[][ruby]{
1.truncate # => 1
1.truncate(2) # => 1
18.truncate(-1) # => 10
(-18).truncate(-1) # => -10
//}
@see Numeric#truncate... -
Integer
# truncate(ndigits = 0) -> Integer | Float (6207.0) -
0 から self までの整数で、自身にもっとも近い整数を返します。
...定した場合、Integer を返します。
小数点位置から左に少なくとも n 個の 0 が並びます。
//emlist[][ruby]{
1.truncate # => 1
1.truncate(2) # => 1.0
18.truncate(-1) # => 10
(-18).truncate(-1) # => -10
//}
@see Numeric#truncate... -
Integer
. each _ prime(upper _ bound) -> Enumerator (201.0) -
全ての素数を列挙し、それぞれの素数をブロックに渡して評価します。
...全ての素数を列挙し、それぞれの素数をブロックに渡して評価します。
@param upper_bound 任意の正の整数を指定します。列挙の上界です。
nil が与えられた場合は無限に列挙し続けます。
@return ブロックの最後... -
Integer
. each _ prime(upper _ bound) {|prime| . . . } -> object (201.0) -
全ての素数を列挙し、それぞれの素数をブロックに渡して評価します。
...全ての素数を列挙し、それぞれの素数をブロックに渡して評価します。
@param upper_bound 任意の正の整数を指定します。列挙の上界です。
nil が与えられた場合は無限に列挙し続けます。
@return ブロックの最後...