(PHP 4, PHP 5, PHP 7)
bcpow — 锟斤拷锟解精锟斤拷锟斤拷锟街的乘凤拷
$left_operand
, string $right_operand
[, int $scale
] ) : string
锟斤拷锟斤拷锟斤拷锟�
锟斤拷锟揭诧拷锟斤拷锟斤拷
锟轿凤拷锟斤拷锟斤拷.
left_operand
锟街凤拷锟斤拷锟斤拷锟酵碉拷锟斤拷锟斤拷锟斤拷锟�.
right_operand
锟街凤拷锟斤拷锟斤拷锟酵碉拷锟揭诧拷锟斤拷锟斤拷.
scale
锟剿匡拷选锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟矫斤拷锟斤拷锟叫★拷锟斤拷锟斤拷锟叫★拷锟轿伙拷锟斤拷锟揭诧拷锟酵拷锟绞癸拷锟� bcscale() 锟斤拷锟斤拷锟斤拷全锟斤拷默锟较碉拷小锟斤拷位锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟叫猴拷锟斤拷锟斤拷
锟斤拷锟截斤拷锟轿拷址锟斤拷锟斤拷锟斤拷锟�.
Example #1 bcpow() 示锟斤拷
<?php
echo bcpow('4.2', '3', 2); // 74.08
?>
Note:
bcpow() may return a result with fewer digits after the decimal point than the
scale
parameter would indicate. This only occurs when the result doesn't require all of the precision allowed by thescale
. For example:Example #2 bcpow() scale example
<?php
echo bcpow('5', '2', 2); // prints "25", not "25.00"
?>