Calculates the arcsecant of this with the highest possible accuracy

@param integer $scale
@return Decimal
8725
public function arcsec(int $scale = null): Decimal
    {
        if($this->comp(DecimalConstants::one(), $scale + 2) === -1 && $this->comp(DecimalConstants::negativeOne(), $scale + 2) === 1) {
            throw new \DomainException(
                "The arcsecant of this number is undefined."
            );
        }

        $piOverTwo = DecimalConstants::pi()->div(Decimal::fromInteger(2), $scale + 2)->round($scale);

        if ($this->round($scale)->equals(DecimalConstants::one())) {
            return DecimalConstants::zero();
        }
        if ($this->round($scale)->equals(DecimalConstants::negativeOne())) {
            return DecimalConstants::pi()->round($scale);
        }

        $scale = ($scale === null) ? 32 : $scale;

        return $piOverTwo->sub(
            self::powerSerie(
                DecimalConstants::one()->div($this, $scale + 2),
                DecimalConstants::zero(),
                $scale + 2
            )
        )->round($scale);
    }
1250230
public function round($decimals = 2) {

		if(false === ('-' . intval($decimals) == '-' . $decimals)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($decimals)), E_USER_ERROR);
		}

		return $this -> convert(function($number, $decimals) {
			return round($number, $decimals);
		}, [$decimals]);
	}
69725
private function valueWithMinScale(int $scale) : string
    {
        $value = $this->value;

        if ($this->value !== '0' && $scale > $this->scale) {
            $value .= \str_repeat('0', $scale - $this->scale);
        }

        return $value;
    }
759956
public function scale($scale)
    {
        $width  = $this->getSourceWidth() * $scale / 100;
        $height = $this->getSourceHeight() * $scale / 100;

        $this->resize($width, $height, true);

        return $this;
    }
560356
public function getPercentage($round = true)
    {
        if ($this->translated === 0 || $this->total === 0) {
            $result = $round ? 0 : 0.0;
        } elseif ($this->translated === $this->total) {
            $result = $round ? 100 : 100.0;
        } else {
            $result = $this->translated * 100.0 / $this->total;
            if ($round) {
                $result = max(1, min(99, (int) round($result)));
            }
        }

        return $result;
    }
513596
public function getTotalPrice( $precision = 2 ) {

		$price	= ( $this->price - $this->discount ) * $this->purchase;

		return round( $price, $precision );
	}
97703
public function modularScale($scale = 0)
        {
            $size = $this->base_font_size;
            $i    = 0;
            if ($scale > 0) {
                while ($i < $scale) {
                    $size = round($size * $this->ratio, 2);
                    $i ++;
                }
            } elseif ($scale < 0) {
                while ($i > $scale) {
                    $size = round($size / $this->ratio, 2);
                    $i --;
                }
            }

            return $size . "px";
        }
528828
public function decimal($column, $length = 10, $scale = 2)
    {
        return $this->addColumn($column, self::TYPE_DECIMAL, array('length' => $length, 'scale' => $scale));
    }
390889
public static function eulerMascheroni(): Decimal
    {
        if (null === self::$EulerMascheroni) {
            self::$EulerMascheroni = Decimal::fromString(
                "0.57721566490153286060651209008240"
            );
        }
        return self::$EulerMascheroni;
    }
1276636
public function mul(Decimal $b, int $scale = null): Decimal
    {
        self::paramsValidation($b, $scale);

        if ($b->isZero()) {
            return DecimalConstants::Zero();
        }

        return self::fromString(
            \bcmul($this->value, $b->value, $this->scale + $b->scale),
            $scale
        );
    }
870238
public function round(int $precision = 0) : self
    {
        if ($precision < 0) {
            throw new InvalidArgumentException('Decimal precision cannot'
                . " be less than 0, $precision given.");
        }

        $b = [];

        foreach ($this->a as $value) {
            $b[] = round($value, $precision);
        }

        return static::quick($b);
    }
552586
public static function goldenRatio(): Decimal
    {
        if (null === self::$GoldenRatio) {
            self::$GoldenRatio = Decimal::fromString(
                "1.61803398874989484820458683436564"
            );
        }
        return self::$GoldenRatio;
    }
438103
public function ceil($scale = 0): Decimal
    {
        if ($scale >= $this->scale) {
            return $this;
        }

        if ($this->isNegative()) {
            return self::fromString(\bcadd($this->value, '0', $scale));
        }

        return $this->innerTruncate($scale);
    }
421281
private float calculateScale(int x, int y) {
		final float centerX = getWidth() / 2f;
		final float centerY = getHeight() / 2f;
		final float maxDistance = (float) Math.sqrt(centerX * centerX + centerY * centerY);

		final float deltaX = centerX - x;
		final float deltaY = centerY - y;
		final float distance = (float) Math.sqrt(deltaX * deltaX + deltaY * deltaY);
		final float scale = 0.5f + (distance / maxDistance) * 0.5f;
		return scale;
	}
938668
public function setScale($scale)
    {
        $valid = ['b', 'c', 'f', 'r'];
        $scale = substr((string) $scale, 0, 1);
        $scale = in_array($scale, $valid)
            ? $scale
            : (!empty($this->thumbConf['cropping']) ? substr($this->thumbConf['cropping'], 0, 1) : 'c');

        $this->scale = $scale;

        return $this;
    }
72078
public function round($precision = 0)
    {
        $precision = max(0, (int) $precision);
        if ($this->hasDecimals()) {
            if ($this->isPositive()) {
                $this->number = bcadd($this->number, '0.' . str_repeat('0', $precision) . '5', $precision);

                return $this;
            }

            $this->number = bcsub($this->number, '0.' . str_repeat('0', $precision) . '5', $precision);
        }

        return $this;
    }
1234742
public function sqrt(int $scale = null): Decimal
    {
        if ($this->isNegative()) {
            throw new \DomainException(
                "Decimal can't handle square roots of negative numbers (it's only for real numbers)."
            );
        } elseif ($this->isZero()) {
            return DecimalConstants::Zero();
        }

        $sqrt_scale = ($scale !== null ? $scale : $this->scale);

        return self::fromString(
            \bcsqrt($this->value, $sqrt_scale+1),
            $sqrt_scale
        );
    }