Neos\Eel\Helper\MathHelper::sign PHP Method

sign() public method

Get the sign of the given number, indicating whether the number is positive, negative or zero
public sign ( integer | float $x ) : integer
$x integer | float The value
return integer -1, 0, 1 depending on the sign or NAN if the given value was not numeric
    public function sign($x)
    {
        if ($x < 0) {
            return -1;
        } elseif ($x > 0) {
            return 1;
        } elseif ($x === 0 || $x === 0.0) {
            return 0;
        } else {
            return NAN;
        }
    }