edwardbrosens/bcmath
Composer 安装命令:
composer require edwardbrosens/bcmath
包简介
Convenience wrapper for the php bcmath extension.
README 文档
README
Convenience wrapper for the php bcmath extension.
Installation
To install BCMath, run:
$ composer require edwardbrosens/bcmath
Requirements
BCMath works with at least PHP 5.6 and HHVM.
Quick Start
require __DIR__ . '/vendor/autoload.php'; use \BCMath\BCMath; // Add two arbitrary precision numbers $a = BCMath::add(1, 2); // ($a = 3) $b = BCMath::sub(2, 1); // ($b = 1)
Available Methods
BCMath::add($left_operand, $right_operand, $scale = null); // Add two arbitrary precision numbers BCMath::sub($left_operand, $right_operand, $scale = null); // Subtract two arbitrary precision numbers BCMath::mul($left_operand, $right_operand, $scale = null); // Multiply two arbitrary precision numbers BCMath::div($left_operand, $right_operand, $scale = null); // Divide two arbitrary precision numbers BCMath::mod($left_operand, $modulus); // Get modulus of an arbitrary precision number BCMath::pow($left_operand, $right_operand, $scale = null); // Raise an arbitrary precision number to another BCMath::sqrt($operand, $scale = null); // Get the square root of an arbitrary precision number BCMath::scale ($scale); // Set default scale parameter for all BCMath and bcmath functions BCMath::comp($left_operand, $right_operand, $scale = null); // Compare two arbitrary precision numbers BCMath::powmod($left_operand, $right_operand, $modulus, $scale = null); // Raise an arbitrary precision number to another, reduced by a specified modulus
Run Tests
To run tests:
$ git clone https://github.com/edwardbrosens/BCMath.git
$ composer install
$ ./vendor/bin/phpunit
Contribute
- Fork the repository on GitHub in order to make changes.
- Write one or more tests for the new feature you're implementing or a fix for the bug you found.
- Send a pull request to get your branch merged.
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-01-23