public static function mode(array $values) : float
    {
        if (empty($values)) {
            throw new InvalidArgumentException('Mode is undefined for empty'
                . ' set.');
        }

        $counts = array_count_values(array_map('strval', $values));

        return (float) argmax($counts);
    }