[READ-ONLY] Mirror of https://github.com/shuuji3/ruby-hack-challenge-2018-int_divisors. RubyHackChallengeの課題1で実装したRubyの拡張ライブラリ。C言語で公倍数の計算、素数/完全数の判定を行う。計算量は考えていないので遅い。
ruby-hack-challenge
0

Configure Feed

Select the types of activity you want to include in your feed.

Makefile 80.3%
Ruby 9.9%
C 9.8%
4 1 0

Clone this repository

https://git.vm.fail/shuuji3.xyz/ruby-hack-challenge-2018-int_divisors https://git.vm.fail/did:plc:okbjudpdb5ru2yrqcfl63xmi
ssh://git@knot1.tangled.sh:2222/shuuji3.xyz/ruby-hack-challenge-2018-int_divisors ssh://git@knot1.tangled.sh:2222/did:plc:okbjudpdb5ru2yrqcfl63xmi

For self-hosted knots, clone URLs may differ based on your setup.


README.md

ruby-hack-challenge-2018-int_divisors#

RubyHackChallengeの課題1で実装したRubyの拡張ライブラリ。

ライブラリの機能#

Integer型に以下のメソッドを追加する。

メソッド名 機能
Integer#divisors 数の公倍数を求め、Arrayとして返す。
Integer#is_prime? 数が素数であるかどうかを返す述語
Integer#is_perfect? 数が完全数であるかどうかを返す述語
  • 注意: 計算量は考えていないので大きな数だとすごく時間がかかる。

ライセンス#