<?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
21Oct2024
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
17Oct2024
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
08Aug2016
: This article mainly introduces the example code for reading very large files in PHP. Students who are interested in PHP tutorials can refer to it.
08Dec2024
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
13Jul2016
Sharing of encapsulation classes for PHP to quickly read large CSV files line by line (also applicable to other very large text files). The reading of large CSV files has been described before (code examples of PHP reading and processing large CSV files line by line), but there are still some problems in how to quickly and completely operate large files.
21Oct2024
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
Hot Tools
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