<commit_before><?php
/**
 * Part of composer package: axelitus/base
 *
 * @package     axelitus\Base
 * @version     0.1
 * @author      <NAME> (<EMAIL>)
 * @license     MIT License
 * @copyright   2013 - <NAME>
 * @link        http://axelitus.mx/projects/axelitus/base
 */

namespace axelitus\Base;

use axelitus\Base\Primitives\Numeric\PrimitiveNumeric;

/**
 * Class Numeric
 *
 * @package axelitus\Base
 */
class Numeric extends PrimitiveNumeric
{
    /**
     * Determines if two given values are equal.
     *
     * The given values $a and $b must be of type numeric. For the sake of this implementation
     * there is no distinction between the == equal operator and the identical === operator.
     *
     * @param int|float|PrimitiveNumeric $a The first of the values to compare.
     * @param int|float|PrimitiveNumeric $b The second of the values to compare.
     * @return bool Returns true if both values are numeric and are equal, false otherwise.
     * @throws \InvalidArgumentException
     */
    final static function isEqual($a, $b)
    {
        if (!static::is($a) or !static::is($b)) {
            throw new \InvalidArgumentException("Both parameters \$a and \$b must be numeric.");
        }

        $val_a = (static::isSimple($a)) ? $a : $a->value();
        $val_b = (static::isSimple($b)) ? $b : $b->value();

        return $val_a == $val_b;
    }
}
<commit_msg>Slightly modified how the values to work with are computed.<commit_after><?php
/**
 * Part of composer package: axelitus/base
 *
 * @package     axelitus\Base
 * @version     0.1
 * @author      <NAME> (<EMAIL>)
 * @license     MIT License
 * @copyright   2013 - <NAME>
 * @link        http://axelitus.mx/projects/axelitus/base
 */

namespace axelitus\Base;

use axelitus\Base\Primitives\Numeric\PrimitiveNumeric;

/**
 * Class Numeric
 *
 * @package axelitus\Base
 */
class Numeric extends PrimitiveNumeric
{
    /**
     * Determines if two given values are equal.
     *
     * The given values $a and $b must be of type numeric. For the sake of this implementation
     * there is no distinction between the == equal operator and the identical === operator.
     *
     * @param int|float|PrimitiveNumeric $a The first of the values to compare.
     * @param int|float|PrimitiveNumeric $b The second of the values to compare.
     * @return bool Returns true if both values are numeric and are equal, false otherwise.
     * @throws \InvalidArgumentException
     */
    final static function isEqual($a, $b)
    {
        if (!static::is($a) or !static::is($b)) {
            throw new \InvalidArgumentException("Both parameters \$a and \$b must be numeric.");
        }

        $val_a = (is_object($a)) ? $a->value() : $a;
        $val_b = (is_object($b)) ? $b->value() : $b;

        return $val_a == $val_b;
    }
}

{'fraction_non_alphanumeric': 0.12455642299503193, 'fraction_numerical': 0.0042583392476933995, 'mean_word_length': 2.7140974967061924, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '791481', 'n_tokens_mistral': 888, 'n_tokens_neox': 842, 'n_words': 279}