mocking-magician/mathoraptor 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mocking-magician/mathoraptor

Composer 安装命令:

composer require mocking-magician/mathoraptor

包简介

Dealing with big numbers in PHP

README 文档

README

mathoraptor is a PHP library for dealing with big number in an object mode.

Install

Simply run

composer require mocking-magician/mathoraptor

Examples

<?

use MockingMagician\Mathoraptor\Number\BigNumber;
use MockingMagician\Mathoraptor\Number\BigInteger;
use MockingMagician\Mathoraptor\Number\BigFraction;
use MockingMagician\Mathoraptor\Exceptions\ParseIntegerException;

// float
$bigNumber = BigNumber::fromString('1.2');
// or integer
$bigNumber = BigNumber::fromString('1');

// or strict integer
$bigInteger = BigInteger::fromString('1');
try {
    // that throw an error if not integer
    $bigInteger = BigInteger::fromString('1.1');
} catch (ParseIntegerException $e) {
}

// fraction
$bigFraction = new BigFraction(BigInteger::fromString('11'), BigInteger::fromString('7'));

// for each number type, available operations are :
// - add
// - sub
// - multiplyBy
// - divideBy

$bigNumber->add($bigInteger); // return a new BigNumber
$bigNumber->sub($bigInteger); // return a new BigNumber
// ... multiplyBy
// ... divideBy

$bigNumber->add($bigFraction); // return a new BigFraction
// ... multiplyBy
// ... divideBy

What's next ?

  • Adding more operation like pow, mod, etc...

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: CC-BY-SA-4.0
  • 更新时间: 2019-07-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固