处理特大数字的PHP库
<?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());
这是一份处理特大数字的PHP库,需要的朋友可以下载使用。
免责声明
本站所有资源均由网友贡献或各大下载网站转载。请自行检查软件的完整性!本站所有资源仅供学习参考。请不要将它们用于商业目的。否则,一切后果由您负责!如有侵权,请联系我们删除。联系方式:admin@php.cn
相关文章

25Nov2024
在 JavaScript 中处理大数:本机 BigInt 与外部库JavaScript 缺乏处理大数的内置解决方案,因此......

04Nov2024
在 JavaScript 中处理庞大的数字面对在 JavaScript 中管理巨大数字的挑战,开发人员寻求有效的解决方案来...


Hot Tools

热门文章
丢失记录:Bloom&Rage -Corey和Dylan的锁组合
19Feb2025手游攻略
Hello Kitty 岛冒险:巧克力猫角色指南
24Jan2025手游攻略
如何修复KB5050081无法在Windows 10中安装?
31Jan2025故障排查
Hello Kitty Island冒险:重新启动机器人任务演练
16Feb2025手游攻略
王朝勇士:起源 - Xinye练习之战
26Jan2025手游攻略