Sha256: 05c3ef70e578d7900c287703ceb14a53c059a19a5deb71db10aa86c3f9e28988
Contents?: true
Size: 176 Bytes
Versions: 6
Compression:
Stored size: 176 Bytes
Contents
module Math # Sign of +x+. # Returns -1 for negative x, +1 for positive x and zero for x = 0 def self.sign(x) (x > 0.0) ? 1.0 : ((x < 0.0) ? -1.0 : 0.0) end end
Version data entries
6 entries across 5 versions & 1 rubygems