Sha256: 08b1503ee3cab7672dc3ba731687a835f4c24f02b8e43e5c80b06a673230f9b2

Contents?: true

Size: 255 Bytes

Versions: 3

Compression:

Stored size: 255 Bytes

Contents

# frozen_string_literal: true

module Basic101

  class SgnFunction < Function

    def name
      'SGN'
    end

    def call(runtime, args)
      check_args args, [BasicNumeric]
      value = args.first.eval(runtime)
      value.sgn
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
basic101-1.0.2 lib/basic101/sgn_function.rb
basic101-1.0.1 lib/basic101/sgn_function.rb
basic101-1.0.0 lib/basic101/sgn_function.rb