PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<aspell_suggestbcadd>
Last updated: Mon, 16 Jul 2012

V. BCMath 任意精度数学函数库

简介

PHP 为任意精度数学计算提供了二进制计算器 (Binary Calculator),他支持任意大小和精度的数字,以字符串形式描述。

需求

自 PHP 4.0.4 以来,libbcmath 都绑定在 PHP 内部。这个扩展不需要其它外部库的支持。

安装

These functions are only available if PHP was configured with --enable-bcmath. In PHP 3, these functions are only available if PHP was not configured with --disable-bcmath.

PHP 的 Windows 版本已经内置该扩展模块的支持。无需加载任何附加扩展库即可使用这些函数。

运行时配置

这些函数的行为受 php.ini 的影响。

表格 1. BC math configuration options

NameDefaultChangeableChangelog
bcmath.scale"0"PHP_INI_ALLAvailable since PHP 5.0.0.
有关 PHP_INI_* 常量进一步的细节与定义参见 附录 H

以下是该配置选项的简要解释。

bcmath.scale integer

Number of decimal digits for all bcmath functions. See also bcscale().

资源类型

本扩展模块未定义任何资源类型。

预定义常量

本扩展模块未定义任何常量。

目录
bcadd -- Add two arbitrary precision numbers
bccomp -- Compare two arbitrary precision numbers
bcdiv -- Divide two arbitrary precision numbers
bcmod --  Get modulus of an arbitrary precision number
bcmul -- Multiply two arbitrary precision number
bcpow --  Raise an arbitrary precision number to another
bcpowmod --  Raise an arbitrary precision number to another, reduced by a specified modulus
bcscale --  Set default scale parameter for all bc math functions
bcsqrt --  Get the square root of an arbitrary precision number
bcsub --  Subtract one arbitrary precision number from another



<aspell_suggestbcadd>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST