<?php namespace Moontoast\Math; class BigNumberTest extends \PHPUnit_Framework_TestCase { protected function setUp() { ini_set('bcmath.scale', 0); } /** * @covers Moontoast\Math\BigNumber::__construct * @covers Moontoast\Math\BigNumber::getValue * @covers Moontoast\Math\BigNumber::getScale * @covers Moontoast\Math\BigNumber::setValue * @covers Moontoast\Math\BigNumber::filterNumber * @covers Moontoast\Math\BigNumber::setDefaultScale */ public function testConstruct() { $bn1 = new BigNumber('9,223,372,036,854,775,808'); $this->assertSame('9223372036854775808', $bn1->getValue()); $this->assertEquals(0, $bn1->getScale()); $bn2 = new BigNumber(2147483647); $this->assertSame('2147483647', $bn2->getValue()); $this->assertEquals(0, $bn2->getScale());
This is a PHP library for processing extremely large numbers. Friends who need it can download it and use it.
All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn
Related Article
![Does PHP Offer a BigInteger Class for Large Integer Handling?](https://img.php.cn/upload/article/001/246/273/172948149059182.jpg)
21 Oct 2024
BigInteger Class in PHPDoes PHP include a BigInteger class for handling large integers? If so, how is it accessed and utilized?Answer:While PHP does not natively include a BigInteger class, external libraries can provide this functionality. Two notab
![What is the Most User-Friendly Form Validation Library for PHP with Comprehensive Features and Robust Error Handling?](https://img.php.cn/upload/article/001/246/273/172914741063665.jpg)
17 Oct 2024
Easiest Form Validation Library for PHPPHP boasts a plethora of validation libraries, each with its own strengths and weaknesses. To identify the ideal choice for your project, it's essential to consider factors such as simplicity, flexibility, and e
![PHP Streams: Efficient Data Handling for Large Files](https://img.php.cn/upload/article/001/246/273/173363695180919.jpg)
08 Dec 2024
Topics: PHP Streams, File Handling in PHP, Large Dataset Processing, CSV Processing, PHP Performance Optimization Table of Contents Introduction Overview of PHP Streams Benefits of Using Streams Hands-On Example with Part-by
![What Mechanisms Does PHP Provide for Handling Large Integers?](https://img.php.cn/upload/article/001/246/273/172948161020289.jpg)
21 Oct 2024
PHP's Built-in BigInteger ClassPHP offers built-in support for handling large-scale integers through the BigInteger class. This class provides efficient operations for manipulating integers beyond the typical integer range.Accessing the BigInteger Cl
![How Can I Optimize PHP for Handling Large File Uploads?](https://img.php.cn/upload/article/001/246/273/173085570489893.jpg)
06 Nov 2024
Fine-Tuning PHP for Large File UploadsUploading hefty files over 500MB can pose a challenge, and PHP configurations play a crucial role in...
![How Can I Optimize My Number Theoretic Transform (NTT) and Modular Arithmetic for Fast Squaring of Very Large Numbers?](https://img.php.cn/upload/article/001/246/273/173451217255093.jpg)
18 Dec 2024
Modular arithmetics and NTT (finite field DFT) optimizationsProblem: I wanted to use NTT for fast squaring (see Fast bignum square...
![](/static/imghw/down_right.png)
![](/static/imghw/taglogo.png)
Hot Tools
![PHP library for dependency injection containers](https://img.php.cn/upload/manual/000/000/001/5e2171bf3c005481.png)
PHP library for dependency injection containers
PHP library for dependency injection containers
A collection of 50 excellent classic PHP algorithms
Classic PHP algorithm, learn excellent ideas and expand your thinking
Small PHP library for optimizing images
Small PHP library for optimizing images
![](/static/imghw/taglogo.png)