@param Point $point
@param bool  $precise

@return int|mixed
348460
public function getDistanceWith(self $point, $precise = true)
    {
        $distance = 0;
        for ($n = 0; $n < $this->dimension; ++$n) {
            $difference = $this->coordinates[$n] - $point->coordinates[$n];
            $distance += $difference * $difference;
        }

        return $precise ? sqrt((float) $distance) : $distance;
    }
461470
public function getPointRgb(Point $position) {
		return imagecolorat($this->image, $position->x, $position->y);
	}
988221
public function equals(self $point)
    {
        return $this->x === $point->getX() &&
        $this->y === $point->getY();
    }
334777
public function getDuration(int $precision = -1)
    {
        //var_dump($this->duration);
        $duration = $this->duration ?? microtime(true) - $this->startTime;
        return $this->fmtDuration($duration, $precision);
    }
653960
public function endpoint($point)
    {
        $endpoint = $this->container->make(Endpoint::class);

        $endpoint
            ->setPoint($point)
            ->add();

        return $this->hang($endpoint);
    }
605701
public function getAsFloat($column, $default = false, $decimals = null, $point = null, $thousands = null)
  {
    if (is_null($decimals)) {
      $decimals = 2;
    }
    if (is_null($point)) {
      $point = '.';
    }
    if (is_null($thousands)) {
      $thousands = '';
    }
    $v = $this->get($column);

    return $v ? number_format($v, $decimals, $point, $thousands) : $default;
  }
398746
public function setPrecision($precision)
	{
		$available = [self::PRECISION_FIXED, self::PRECISION_DOUBLE, self::PRECISION_FLOAT];
		
		if ( ! is_scalar($precision) || ! in_array($precision, $available, false))
		{
			throw new \InvalidArgumentException(sprintf('Wrong precision value for %s, available values are %s',
				(string) $precision, implode(', ', $available)));
		}
		
		$this->precision = (string) $precision;
		
		return $this;
	}
344675
private function getPointcut(): Pointcut
    {
        if (!$this->pointcut) {
            $this->pointcut = $this->container->getPointcut($this->pointcutId);
        }

        return $this->pointcut;
    }
1091428
private function precision($number)
        {
            $precision = 0;
            $pt = strpos($number, '.');

            if ($pt !== false) {
                $precision = -(strlen($number) - $pt - 1);
            }

            return pow(10, $precision) / 2;
        }
956165
public function setPointerPosition( int $offset = 0 ) : bool
   {

      if ( ! \is_resource( $this->fp ) )
      {
         return false;
      }

      return (bool) \fseek( $this->fp, $offset );

   }
212897
public function getPointColor(Point $position) {
		return new Color(imagecolorat($this->image, $position->x, $position->y));
	}
1203015
public function format($decimals = 2, $point = '.', $thousands_sep = ',', $currency = null) {

		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);
		}

		if(false === is_string($point)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($point)), E_USER_ERROR);
		}

		if(false === is_string($thousands_sep)) {
			return trigger_error(sprintf('Argument 3 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($thousands_sep)), E_USER_ERROR);
		}

		if(null !== $currency && false === is_string($currency)) {
			return trigger_error(sprintf('Argument 4 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($currency)), E_USER_ERROR);
		}

		return $this -> convert(function($number, $decimals, $point, $thousands_sep, $currency) {
			return ($currency ?: $currency) . number_format($number, $decimals, $point, $thousands_sep);
		}, [$decimals, $point, $thousands_sep, $currency]);
	}
214377
public function roundUp(int $precision = 0): Utility
    {
        return $this->round($this->number, $precision, PHP_ROUND_HALF_UP);
    }
139373
public static function ceil($num, int $precision=0) {
		ref\format::ceil($num, $precision);
		return $num;
	}
32185
public static function pointDouble(PointInterface $point, CurveParameterInterface $parameters = null)
    {
        if ($point->isInfinity()) {
            return $point;
        }

        if (null === $parameters) {
            $parameters = new Secp256k1();
        }

        $p = $parameters->pHex();
        $a = $parameters->aHex();

        $s = 0;
        $R = array(
            'x' => 0,
            'y' => 0,
        );

        // Critical math section
        try {
            $m      = Math::add(Math::mul(3, Math::mul($point->getX(), $point->getX())), $a);
            $o      = Math::mul(2, $point->getY());
            $n      = Math::invertm($o, $p);
            $n2     = Math::mod($o, $p);
            $st     = Math::mul($m, $n);
            $st2    = Math::mul($m, $n2);
            $s      = Math::mod($st, $p);
            $s2     = Math::mod($st2, $p);
            $xmul   = Math::mul(2, $point->getX());
            $smul   = Math::mul($s, $s);
            $xsub   = Math::sub($smul, $xmul);
            $xmod   = Math::mod($xsub, $p);
            $R['x'] = $xmod;
            $ysub   = Math::sub($point->getX(), $R['x']);
            $ymul   = Math::mul($s, $ysub);
            $ysub2  = Math::sub(0, $point->getY());
            $yadd   = Math::add($ysub2, $ymul);

            $R['y'] = Math::mod($yadd, $p);

        } catch (\Exception $e) {
            throw new \Exception('Error in Util::pointDouble(): '.$e->getMessage());
        }

        return new Point($R['x'], $R['y']);
    }
738095
public function getRuntime(int $precision = 10)
    {
        if ($this->startTime == $this::NOT_INITIALIZED || $this->endTime == $this::NOT_INITIALIZED) {
            return FALSE;
        }

        $runTime = round($this->endTime - $this->startTime, $precision);

        return $runTime;
    }
165495
public function notEnoughPointToUse(...$points)
    {
        $currentPoint = $this->currentPoint();
        /**
         * 檢查是不是有足夠的點數可以用
         *
         * 如果傳入值是 int，只需要比對總數是否足夠
         *
         * 如果傳入陣列，則需每個比對是否足夠，如果不夠，回應差多少
         */
        if (is_int($points[0]))
            return $currentPoint < $points[0];

        $currentPoint = $this->getCanUsePoints();
        $points = array_shift($points);
        $notEnoughPoint = collect($points)->map(function ($point, $key) use ($currentPoint) {

            $pointType = $currentPoint->where('name', $key)->first();

            //如果使用者沒有擁有這個點數
            if (is_null($pointType))
                return false;
//                return 0 - $pointType;
            //如果使用者這這個點數項目不夠
            else if ($pointType->number < $point)
                return false;
            //返回扣除後剩下幾點
            else
                return $pointType->number - $point;
        })->values()->all();


        return in_array(false ,$notEnoughPoint ,true);
    }