class Sass::Script::Number

def eq(other)

Returns:
  • (Boolean) - Whether this number is equal to the other object

Parameters:
  • other (Literal) -- The right-hand side of the operator
def eq(other)
  return Sass::Script::Bool.new(false) unless other.is_a?(Sass::Script::Number)
  this = self
  begin
    if unitless?
      this = this.coerce(other.numerator_units, other.denominator_units)
    else
      other = other.coerce(numerator_units, denominator_units)
    end
  rescue Sass::UnitConversionError
    return Sass::Script::Bool.new(false)
  end
  Sass::Script::Bool.new(this.value == other.value)
end