Class: RMasm::Double

Inherits:
Primitive show all
Defined in:
lib/rmasm/primitive.rb

Overview

Represents a float IEE-754 (32 bits)

Constant Summary collapse

MIN =
-1.7976931348623158e+308
MAX =
1.7976931348623158e+308

Instance Attribute Summary

Attributes inherited from Primitive

#value

Class Method Summary collapse

Methods inherited from Primitive

from_str

Methods inherited from DataType

read, write

Class Method Details

.rangeObject



188
189
190
# File 'lib/rmasm/primitive.rb', line 188

def self.range
  MIN..MAX
end

.sizeofObject



194
195
196
# File 'lib/rmasm/primitive.rb', line 194

def self.sizeof
  8
end

.to_sObject



197
198
199
# File 'lib/rmasm/primitive.rb', line 197

def self.to_s
  "double"
end

.valid?(arg) ⇒ Boolean

Returns:

  • (Boolean)


191
192
193
# File 'lib/rmasm/primitive.rb', line 191

def self.valid?(arg)
  return range === arg && arg.is_a?(Numeric)
end