class Basic101::BasicFloat
Public Class Methods
from_s(s)
click to toggle source
# File lib/basic101/basic_float.rb, line 9 def self.from_s(s) value = s.to_f new(value) end
Public Instance Methods
and(other)
click to toggle source
# File lib/basic101/basic_float.rb, line 30 def and(other) to_integer.and(other) end
floor()
click to toggle source
# File lib/basic101/basic_float.rb, line 38 def floor BasicInteger.new(@value.floor) end
not()
click to toggle source
# File lib/basic101/basic_float.rb, line 34 def not to_integer.not end
or(other)
click to toggle source
# File lib/basic101/basic_float.rb, line 26 def or(other) to_integer.or(other) end
str()
click to toggle source
# File lib/basic101/basic_float.rb, line 22 def str BasicString.new(@value.to_s) end
to_float()
click to toggle source
# File lib/basic101/basic_float.rb, line 18 def to_float self end
to_integer()
click to toggle source
# File lib/basic101/basic_float.rb, line 14 def to_integer BasicInteger.new(@value.to_i) end
Private Instance Methods
format()
click to toggle source
# File lib/basic101/basic_float.rb, line 44 def format '%.7g' % @value end