Sha256: e5370fcc679da15a29553c3f8e831596e111b32ca75c344de4d2c4359d59e611

Contents?: true

Size: 141 Bytes

Versions: 20

Compression:

Stored size: 141 Bytes

Contents

# coding: utf-8
class Integer
  def core
    raise ArgumentError if self <= 0
    divisors.sort.select{|m| (self/m).square?}.first
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
numb-0.186.0 lib/numb/core.rb
numb-0.185.0 lib/numb/core.rb
numb-0.184.0 lib/numb/core.rb
numb-0.181.0 lib/numb/core.rb
numb-0.170.0 lib/numb/core.rb
numb-0.152.0 lib/numb/core.rb
numb-0.138.0 lib/numb/core.rb
numb-0.125.0 lib/numb/core.rb
numb-0.114.0 lib/numb/core.rb
numb-0.111.0 lib/numb/core.rb
numb-0.109.0 lib/numb/core.rb
numb-0.99.0 lib/numb/core.rb
numb-0.96.0 lib/numb/core.rb
numb-0.89.0 lib/numb/core.rb
numb-0.84.0 lib/numb/core.rb
numb-0.77.0 lib/numb/core.rb
numb-0.72.1 lib/numb/core.rb
numb-0.72.0 lib/numb/core.rb
numb-0.68.0 lib/numb/core.rb
numb-0.63.0 lib/numb/core.rb