コード例 #1
0
ファイル: Quantity.php プロジェクト: rawroland/Newton
 /**
  * Attempts to take the square root of this unit. In practice it is very rare for a unit that has a common purpose
  * or name on its own to be rooted. Instead it is more common for the square root to occur after a series of
  * multiplication and division, so you may provide numerators and denominators to this method as well which will
  * occur BEFORE the square root is taken.
  *
  * @param   Quantity[] $numerators
  * @param   Quantity[] $denominators
  * @param   int $precision
  * @return  Quantity
  * @throws  \Exception
  */
 public function squareRoot(array $numerators = [], array $denominators = [], $precision = 2)
 {
     $numerators[] = $this;
     return $this->unitCompClass->naiveSquareRoot($numerators, $denominators, $precision);
 }