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

Version Path
facets-2.9.3 lib/standard/facets/math/sign.rb
facets-2.9.2 lib/standard/facets/math/sign.rb
facets-2.9.2 src/standard/facets/math/sign.rb
facets-2.9.1 lib/standard/facets/math/sign.rb
facets-2.9.0 lib/more/facets/math/sign.rb
facets-2.9.0.pre.2 lib/more/facets/math/sign.rb