Class: BareTypes::F32
Overview
Class Method Summary
collapse
Instance Method Summary
collapse
#==, #finalize_references, #to_schema
Methods inherited from BaseType
#cycle_search, #initialize
Class Method Details
.make(depth, names) ⇒ Object
108
109
110
|
# File 'lib/generative_testing/monkey_patch.rb', line 108
def self.make(depth, names)
self.new
end
|
Instance Method Details
112
113
114
115
116
117
118
119
120
121
122
|
# File 'lib/generative_testing/monkey_patch.rb', line 112
def create_input
float = nil
loop do
input = [rand(266), rand(266), rand(266), rand(266)]
float = input.pack("cccc").unpack('e')
if float[0] == float[0] && !float[0].nan?
break
end
end
float[0]
end
|
#decode(msg) ⇒ Object
184
185
186
|
# File 'lib/types.rb', line 184
def decode(msg)
return msg.unpack("e")[0], msg[4..msg.size]
end
|
#encode(msg, buffer) ⇒ Object
180
181
182
|
# File 'lib/types.rb', line 180
def encode(msg, buffer)
buffer << [msg].pack("e")
end
|