るりまサーチ (Ruby 3.4)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.086秒)

別のキーワード

  1. openssl integer
  2. asn1 integer
  3. _builtin integer
  4. integer digits
  5. integer new

ライブラリ

クラス

検索結果

Integer#ceildiv(other) -> Integer (81718.0)

self を other で割り、その(剰余を考えない)商を整数に切り上げたものを返します。 すなわち、self を other で割った商を q とすると、q 以上で最小の整数を返します。

self を other で割り、その(剰余を考えない)商を整数に切り上げたものを返します。
すなわち、self を other で割った商を q とすると、q 以上で最小の整数を返します。

@param other self を割る数を指定します。

//emlist[][ruby]{
3.ceildiv(3) # => 1
4.ceildiv(3) # => 2
5.ceildiv(3) # => 2
3.ceildiv(1.2) # => 3
-5.ceildiv(3) # => -1
-5.ceildiv(-3) # => 2
//}