るりまサーチ

最速Rubyリファレンスマニュアル検索!
3件ヒット [1-3件を表示] (0.017秒)
トップページ > クラス:Integer[x] > ライブラリ:mathn[x]

検索結果

Integer#gcd2(int) (3)

@todo

@todo

例:

12.gcd2 8
# => 4

Integer#prime_division (3)

@todo

@todo

各素因子について素因子と指数の組を並べた配列を返します。

例:

72.prime_division
# => [[2, 3], [3, 2]]

Integer.from_prime_division(pd) -> Integer (3)

素因数分解の配列 pd から数を求めます。 pd は [素因数, 指数] 組の配列です。

...素因数分解の配列 pd から数を求めます。
pd は [素因数, 指数] 組の配列です。

例:

Integer
.from_prime_division [[2,3],[3,2]]
# => 72 == 2**3 * 3**2...