E
Erik Terpstra
Why is the last expression false?
class Part
attr_reader :x, :y, :x2, :y2
def height
y2 - y
end
def initialize(x, y, x2, y2)
@x, @y, @x2, @y2 = x, y, x2, y2
end
end
part = Part.new(200.40, 248.32, 417.0, 306.52)
puts "part.height == #{part.height.inspect}" # part.height == 58.2
p part.height == 58.2 #-> false !!??
class Part
attr_reader :x, :y, :x2, :y2
def height
y2 - y
end
def initialize(x, y, x2, y2)
@x, @y, @x2, @y2 = x, y, x2, y2
end
end
part = Part.new(200.40, 248.32, 417.0, 306.52)
puts "part.height == #{part.height.inspect}" # part.height == 58.2
p part.height == 58.2 #-> false !!??