Class: Antlr4::Runtime::Integer

Inherits:
Object
  • Object
show all
Defined in:
lib/antlr4/runtime/integer.rb

Constant Summary collapse

N_BYTES =
[42].pack('i').size
N_BITS =
N_BYTES * 16
MAX =
2 ** (N_BITS - 2) - 1
MIN =
- 1

Class Method Summary collapse

Class Method Details

.signum(x) ⇒ Object


8
9
10
11
12
# File 'lib/antlr4/runtime/integer.rb', line 8

def self.signum(x)
  return 0 if x.zero?
  return -1 if x < 0
  1
end