Class: RMasm::Float

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

Overview

Represents a float IEE-754 (32 bits)

Constant Summary collapse

MIN =
-3.402823466e+38
MAX =
3.402823466e+38

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



165
166
167
# File 'lib/rmasm/primitive.rb', line 165

def self.range
  MIN..MAX
end

.sizeofObject



171
172
173
# File 'lib/rmasm/primitive.rb', line 171

def self.sizeof
  4
end

.to_sObject



174
175
176
# File 'lib/rmasm/primitive.rb', line 174

def self.to_s
  "float"
end

.valid?(arg) ⇒ Boolean

Returns:

  • (Boolean)


168
169
170
# File 'lib/rmasm/primitive.rb', line 168

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