2017 © Pedro Peláez
 

library math

A simple wrapper for BC Math

image

philipbrown/math

A simple wrapper for BC Math

  • Saturday, October 4, 2014
  • by philipbrown
  • Repository
  • 1 Watchers
  • 6 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Math

A simple wrapper for BC Math, (*1)

Build Status Code Coverage Scrutinizer Code Quality, (*2)

Installation

Add philipbrown/math as a requirement to composer.json:, (*3)

{
  "require": {
    "philipbrown/math": "~2.0"
  }
}

Update your packages with composer update., (*4)

Usage

use PhilipBrown\Math\Math;

/**
 * Add
 *
 * @param mixed $left
 * @param mixed $right
 * @param mixed $scale
 * @return PhilipBrown\Math\Number
 */
$number = Math::add(1.04, 2.406, 4);

/**
 * Compare
 *
 * @param mixed $left
 * @param mixed $right
 * @param mixed $scale
 * @return PhilipBrown\Math\Number
 */
$number = Math::compare(2.4567, 2.4566, 4);

/**
 * Divide
 *
 * @param mixed $left
 * @param mixed $right
 * @param mixed $scale
 * @return PhilipBrown\Math\Number
 */
$number = Math::divide(23.3945, 5, 4);

/**
 * Modulus
 *
 * @param mixed $operand
 * @param mixed $modulus
 * @return PhilipBrown\Math\Number
 */
$number = Math::modulus(10, 3);

/**
 * Multiply
 *
 * @param mixed $left
 * @param mixed $right
 * @param mixed $scale
 * @return PhilipBrown\Math\Number
 */
$number = Math::multiply(5.34, 2.2, 3);

/**
 * Power
 *
 * @param mixed $left
 * @param mixed $right
 * @param mixed $scale
 * @return PhilipBrown\Math\Number
 */
$number = Math::power(43.22, 2, 5);

/**
 * Square Root
 *
 * @param mixed $operand
 * @param mixed $scale
 * @return PhilipBrown\Math\Number
 */
$number = Math::squareRoot(454.213, 4);

/**
 * Subtract
 *
 * @param mixed $left
 * @param mixed $right
 * @param mixed $scale
 * @return PhilipBrown\Math\Number
 */
$number = Math::subtract(10.888, 2.123, 3);

The Versions

04/10 2014

dev-master

9999999-dev

A simple wrapper for BC Math

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philip Brown

04/10 2014

v2.0.1

2.0.1.0

A simple wrapper for BC Math

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philip Brown

30/09 2014

v2.0

2.0.0.0

A simple wrapper for BC Math

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philip Brown

20/04 2014

v1.0.0

1.0.0.0

A simple wrapper for BC Math

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Philip Brown