[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/brick/math/src/Internal/Calculator/ -> NativeCalculator.php (summary)

(no description)

File Size: 616 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

NativeCalculator:: (16 methods):
  __construct()
  add()
  sub()
  mul()
  divQ()
  divR()
  divQR()
  pow()
  modPow()
  sqrt()
  doAdd()
  doSub()
  doMul()
  doDiv()
  doCmp()
  pad()


Class: NativeCalculator  - X-Ref

Calculator implementation using only native PHP code.

__construct()   X-Ref
Class constructor.


add(string $a, string $b)   X-Ref
{@inheritdoc}


sub(string $a, string $b)   X-Ref
{@inheritdoc}


mul(string $a, string $b)   X-Ref
{@inheritdoc}


divQ(string $a, string $b)   X-Ref
{@inheritdoc}


divR(string $a, string $b)   X-Ref
{@inheritdoc}


divQR(string $a, string $b)   X-Ref
{@inheritdoc}


pow(string $a, int $e)   X-Ref
{@inheritdoc}


modPow(string $base, string $exp, string $mod)   X-Ref
Algorithm from: https://www.geeksforgeeks.org/modular-exponentiation-power-in-modular-arithmetic/

{@inheritdoc}

sqrt(string $n)   X-Ref
Adapted from https://cp-algorithms.com/num_methods/roots_newton.html

{@inheritDoc}

doAdd(string $a, string $b)   X-Ref
Performs the addition of two non-signed large integers.

param: string $a The first operand.
param: string $b The second operand.
return: string

doSub(string $a, string $b)   X-Ref
Performs the subtraction of two non-signed large integers.

param: string $a The first operand.
param: string $b The second operand.
return: string

doMul(string $a, string $b)   X-Ref
Performs the multiplication of two non-signed large integers.

param: string $a The first operand.
param: string $b The second operand.
return: string

doDiv(string $a, string $b)   X-Ref
Performs the division of two non-signed large integers.

param: string $a The first operand.
param: string $b The second operand.
return: string[] The quotient and remainder.

doCmp(string $a, string $b)   X-Ref
Compares two non-signed large numbers.

param: string $a The first operand.
param: string $b The second operand.
return: int [-1, 0, 1]

pad(string $a, string $b)   X-Ref
Pads the left of one of the given numbers with zeros if necessary to make both numbers the same length.

The numbers must only consist of digits, without leading minus sign.

param: string $a The first operand.
param: string $b The second operand.
return: array{0: string, 1: string, 2: int}



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer