public function compare($x): int
    {
        // if $x is not numeric, short-circuit
        if ( ! is_numeric($x)) {
            throw new InvalidArgumentException(
                __METHOD__ . "() expects parameter one, x, to be a number"
            );    
        }
        
        if (
            $x < $this->lower 
            || ( ! $this->isLowerInclusive && $x == $this->lower)
        ) {
            return -1;
        } elseif (
            $x > $this->upper 
            || ( ! $this->isUpperInclusive && $x == $this->upper)
        ) {
            return 1;
        } else {
            return 0;
        }
    }