SassNumber::op_div PHP Method

op_div() public method

Divides this value by the value of other
public op_div ( $other ) : mixed
return mixed SassNumber if other is a SassNumber or SassColour if it is a SassColour
    public function op_div($other)
    {
        if ($other instanceof SassColour) {
            return $other->op_div($this);
        } elseif (!$other instanceof SassNumber) {
            throw new SassNumberException('Number must be a number', SassScriptParser::$context->node);
        } elseif ($this->inExpression || $other->inExpression) {
            return new SassNumber($this->value / $other->value . $this->unitString(array_merge($this->numeratorUnits, $other->denominatorUnits), array_merge($this->denominatorUnits, $other->numeratorUnits)));
        } else {
            return new SassNumber($this->value / $other->value . $this->unitString(array_merge($this->numeratorUnits, $other->denominatorUnits), $this->denominatorUnits));
        }
    }