Returns the object's logarithm in base 10
@param  integer $scale
@return Decimal
517515
public function log10(int $scale = null): Decimal
    {
        if ($this->isNegative()) {
            throw new \DomainException(
                "Decimal can't handle logarithms of negative numbers (it's only for real numbers)."
            );
        } elseif ($this->isZero()) {
            throw new \DomainException(
                "Decimal can't represent infinite numbers."
            );
        }

        return self::fromString(
            self::innerLog10($this->value, $this->scale, $scale !== null ? $scale+1 : $this->scale+1),
            $scale
        );
    }
379735
public static function fromDecimal(Decimal $decValue, int $scale = null): Decimal
    {
        self::paramsValidation($decValue, $scale);

        // This block protect us from unnecessary additional instances
        if ($scale === null || $scale >= $decValue->scale) {
            return $decValue;
        }

        return new static(
            self::innerRound($decValue->value, $scale),
            $scale
        );
    }
1252240
private static function formatFloat($f, $precision)
    {
        $scale = pow(10, max(0, $precision));
        // clear off additional digits so that number_format doesn't round numbers
        $i = (int)($f * $scale) / $scale;
        return number_format($i, $precision, '.', '');
    }
1077216
public function getLevelNumericalValue($level) {
		$level = strtolower($level);
		if (isset($this->levelValues[$level])) {
			return $this->levelValues[$level];
		}

		return 0;
	}
702379
public static function exponent($value, $scale = null)
    {
        if (!extension_loaded('bcmath')) {
            return $value;
        }

        $split = explode('e', $value);
        if (count($split) == 1) {
            $split = explode('E', $value);
        }

        if (count($split) > 1) {
            $value = bcmul($split[0], bcpow(10, $split[1], $scale), $scale);
        }

        return $value;
    }
377500
private function encodeFloat($float, $precision)
    {
        $log = (int) floor(log(abs($float), 10));

        if ($log > -5 && abs($float) < self::FLOAT_MAX && abs($log) < $precision) {
            return $this->formatFloat($float, $precision - $log - 1);
        }

        // Deal with overflow that results from rounding
        $log += (int) (round(abs($float) / 10 ** $log, $precision - 1) / 10);
        $string = $this->formatFloat($float / 10 ** $log, $precision - 1);

        return sprintf('%sE%+d', $string, $log);
    }
759956
public function scale($scale)
    {
        $width  = $this->getSourceWidth() * $scale / 100;
        $height = $this->getSourceHeight() * $scale / 100;

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

        return $this;
    }
301609
private function convertLevel($level)
    {
        # If this is one of the defined string log levels then return it's numeric value
        if (!array_key_exists($level, $this->levels)) {
            throw new InvalidArgumentException("Unknown log level: {$level}");
        }

        return $this->levels[$level];
    }
832670
public function cotan(int $scale = null): Decimal
    {
	    $sin = $this->sin($scale + 2);
	    if ($sin->isZero()) {
	        throw new \DomainException(
	            "The cotangent of this 'angle' is undefined."
	        );
	    }

	    return $this->cos($scale + 2)->div($sin)->round($scale);
    }
1172171
public static function round($arg1, $scale = 0) : string {
		if (!isset($scale)) {
			$scale = self::$scale;
		}
		if ($arg1[0] != '-') {
			return bcadd($arg1, '0.' . str_repeat('0', $scale) . '5', $scale);
		} else {
			return bcsub($arg1, '0.' . str_repeat('0', $scale) . '5', $scale);
		}
	}
105421
public function decimal($column, $precision = 8, $scale = 2)
    {
        return $this->table->addColumn($column, Type::DECIMAL, compact('precision', 'scale'));
    }
792980
public static double logpdf(double val, double loc, double scale) {
    val = Math.abs((val - loc) / scale);
    double f = 1.0 + FastMath.exp(-val);
    return -val - FastMath.log(scale * f * f);
  }
20160
public static double logquantile(double val, double loc, double scale) {
    return loc + scale * (val - MathUtil.log1mexp(-val));
  }
1121020
public function Equals( $number, $scale = false )
	{
		$result = $this->Compare( $number, $scale );
		if ( $result === false ) return false;
		return $result == 0;
	}
947339
public void setScale(double scale)
    {
        if(scale <= 0 || Double.isNaN(scale) || Double.isInfinite(scale))
            throw new ArithmeticException("Scale must be a positive value, not " + scale);
        this.scale = scale;
        this.logScale = log(scale);
    }
68284
public static function getLevelNumeric(string $level)
    {
        return isset(self::$LEVEL_NUMERIC[$level]) ? self::$LEVEL_NUMERIC[$level] : 0;
    }
903497
public function getDistance($lat, $lng, $scale = 'km'){
		return GeoFunctions::getDistance($this->getLatitude(), $this->getLongditude(), $lat, $long, $scale);
	}