Class: Rubex::DataType::F64
- Inherits:
-
Object
- Object
- Rubex::DataType::F64
show all
- Includes:
- FloatHelpers
- Defined in:
- lib/rubex/data_type/f_64.rb
Instance Method Summary
collapse
Methods included from Helpers
#==, #base_type, #c_function_ptr?, #char_ptr?
Instance Method Details
#<=>(other) ⇒ Object
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/rubex/data_type/f_64.rb', line 25
def <=>(other)
if other.char? || other.int8? || other.int16? || other.int32? ||
other.int64? || other.int? || other.uint8? || other.uint16? ||
other.uint32? || other.uint64? || other.float32?
1
elsif other.float64?
0
else
-1
end
end
|
17
18
19
|
# File 'lib/rubex/data_type/f_64.rb', line 17
def float64?
true
end
|
#from_ruby_object(arg) ⇒ Object
13
14
15
|
# File 'lib/rubex/data_type/f_64.rb', line 13
def from_ruby_object(arg)
"NUM2DBL(#{arg})"
end
|
21
22
23
|
# File 'lib/rubex/data_type/f_64.rb', line 21
def p_formatter
'%f'
end
|
#to_ruby_object(arg) ⇒ Object
9
10
11
|
# File 'lib/rubex/data_type/f_64.rb', line 9
def to_ruby_object(arg)
"rb_float_new(#{arg})"
end
|
#to_s ⇒ Object
5
6
7
|
# File 'lib/rubex/data_type/f_64.rb', line 5
def to_s
'double'
end
|