class Sass::Script::Number

def mod(other)

Raises:
  • (Sass::UnitConversionError) - if `other` has any units
  • (NoMethodError) - if `other` is an invalid type

Returns:
  • (Number) - This number modulo the other

Parameters:
  • other (Number) -- The right-hand side of the operator
def mod(other)
  if other.is_a?(Number)
    unless other.unitless?
      raise Sass::UnitConversionError.new("Cannot modulo by a number with units: #{other.inspect}.")
    end
    operate(other, :%)
  else
    raise NoMethodError.new(nil, :mod)
  end
end