abs

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Absolute value
<?php abs(int|float $num): int|float
<?php     public static function take($array, $limit)

    {

        if ($limit < 0) {

            return array_slice($array, $limit, abs($limit));

        }



        return array_slice($array, 0, $limit);
<?php     public function take($limit)

    {

        if ($limit < 0) {

            return $this->slice($limit, abs($limit));

        }



        return $this->slice(0, $limit);
<?php     {

        if ($limit < 0) {

            return new static(function () use ($limit) {

                $limit = abs($limit);

                $ringBuffer = [];

                $position = 0;
<?php                 return false;

            }



            return abs($this->castAttribute($key, $attribute) - $this->castAttribute($key, $original)) < PHP_FLOAT_EPSILON * 4;

        } elseif ($this->isEncryptedCastable($key) && ! empty(static::currentEncrypter()->getPreviousKeys())) {

            return false;

        } elseif ($this->hasCast($key, static::$primitiveCastTypes)) {
<?php         if (isset($i)) {

            return vsprintf('case when %s then %s else false end', [

                'jsonb_typeof(('.$column.")::jsonb) = 'array'",

                'jsonb_array_length(('.$column.')::jsonb) >= '.($i < 0 ? abs($i) : $i + 1),

            ]);

        }
<?php             case floatval($number) === 0.0:

                return $precision > 0 ? static::format(0, $precision, $maxPrecision) : '0';

            case $number < 0:

                return sprintf('-%s', static::summarize(abs($number), $precision, $maxPrecision, $units));

            case $number >= 1e15:

                return sprintf('%s'.end($units), static::summarize($number / 1e15, $precision, $maxPrecision, $units));

        }
<?php             $count = count($count);

        }



        if ((int) abs($count) === 1 || static::uncountable($value) || preg_match('/^(.*)[A-Za-z0-9\x{0080}-\x{FFFF}]$/u', $value) == 0) {

            return $value;

        }
<?php         $precision = 1 / (max($width, $height) + 1);



        return abs($numerator / $denominator - $width / $height) > $precision;

    }
<?php         $alpha_tolerance = round($tolerance * 1.27);



        $delta = [

            'r' => abs($color->r - $this->r),

            'g' => abs($color->g - $this->g),

            'b' => abs($color->b - $this->b),

            'a' => abs($color->a - $this->a)
<?php         $delta = [

            'r' => abs($color->r - $this->r),

            'g' => abs($color->g - $this->g),

            'b' => abs($color->b - $this->b),

            'a' => abs($color->a - $this->a)

        ];
<?php         $delta = [

            'r' => abs($color->r - $this->r),

            'g' => abs($color->g - $this->g),

            'b' => abs($color->b - $this->b),

            'a' => abs($color->a - $this->a)

        ];
<?php             'r' => abs($color->r - $this->r),

            'g' => abs($color->g - $this->g),

            'b' => abs($color->b - $this->b),

            'a' => abs($color->a - $this->a)

        ];



        return (
<?php                 }

            }



            $box['width'] = intval(abs($box[4] - $box[0]));

            $box['height'] = intval(abs($box[5] - $box[1]));



        } else {
<?php             }



            $box['width'] = intval(abs($box[4] - $box[0]));

            $box['height'] = intval(abs($box[5] - $box[1]));



        } else {
<?php         $alpha_tolerance = round($tolerance);



        $delta = [

            'r' => abs($color->getRedValue() - $this->getRedValue()),

            'g' => abs($color->getGreenValue() - $this->getGreenValue()),

            'b' => abs($color->getBlueValue() - $this->getBlueValue()),

            'a' => abs($color->getAlphaValue() - $this->getAlphaValue())