Sha256: 02af763566b730aaaad1a23a618022de3c8bf5caf25a048828311bb2ce1f7ca6
Contents?: true
Size: 172 Bytes
Versions: 1
Compression:
Stored size: 172 Bytes
Contents
# coding: utf-8 class Integer def square? return false unless zero? or (positive? and to_s(16)[-1] =~ /[0149]/) (sq = sqrt).finite? ? sq.integer? : nil end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
numb-0.152.0 | lib/numb/square.rb |