PHP code example of xp-framework / math

1. Go to this page and download the library: Download xp-framework/math library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

xp-framework / math example snippets


public class math.BigInt extends math.BigNum {
  public math.BigInt __construct(int|float|string|parent $in)

  public math.BigNum add(int|float|string|parent $other)
  public math.BigNum subtract(int|float|string|parent $other)
  public math.BigNum multiply(int|float|string|parent $other)
  public math.BigNum divide(int|float|string|parent $other)
  public math.BigNum add0(int|float|string|parent $other)
  public math.BigNum subtract0(int|float|string|parent $other)
  public math.BigNum multiply0(int|float|string|parent $other)
  public math.BigNum divide0(int|float|string|parent $other)
  public math.BigNum power(int|float|string|parent $other)
  public math.BigNum modulo(int|float|string|parent $other)
  public math.BigNum bitwiseAnd(int|float|string|parent $other)
  public math.BigNum bitwiseOr(int|float|string|parent $other)
  public math.BigNum bitwiseXor(int|float|string|parent $other)
  public math.BigNum shiftRight(int|float|string|parent $shift)
  public math.BigNum shiftLeft(int|float|string|parent $shift)
  public int byteValue()
  public int intValue()
  public float floatValue()
}

public class math.BigFloat extends math.BigNum {
  public math.BigFloat __construct(int|float|string|parent $in)

  public math.BigNum add(int|float|string|parent $other)
  public math.BigNum subtract(int|float|string|parent $other)
  public math.BigNum multiply(int|float|string|parent $other)
  public math.BigNum divide(int|float|string|parent $other)
  public math.BigNum power(int|float|string|parent $other)
  public math.BigFloat ceil()
  public math.BigFloat floor()
  public math.BigFloat round([int $precision= 0])
  public int compare(int|float|string|parent $other, ?int $precision= null)
  public bool equals(int|float|string|parent $other, ?int $precision= null)
  public int intValue()
  public float floatValue()
}