You are here

public static function SassScriptFunctions::comparable in Sassy 7.3

Same name and namespace in other branches
  1. 7 phamlp/sass/script/SassScriptFunctions.php \SassScriptFunctions::comparable()

Returns true if two numbers are similar enough to be added, subtracted, or compared.

Parameters

SassNumber The first number to test:

SassNumber The second number to test:

Return value

new SassBoolean True if the numbers are similar

Throws

SassScriptFunctionException If $number1 or $number2 is not a number

File

phpsass/script/SassScriptFunctions.php, line 632

Class

SassScriptFunctions
SassScript functions class. A collection of functions for use in SassSCript. @package PHamlP @subpackage Sass.script

Code

public static function comparable($number1, $number2) {
  SassLiteral::assertType($number1, 'SassNumber');
  SassLiteral::assertType($number2, 'SassNumber');
  return new SassBoolean($number1
    ->isComparableTo($number2));
}