bcpow

(PHP 4, PHP 5, PHP 7)

bcpow锟斤拷锟解精锟斤拷锟斤拷锟街的乘凤拷

说锟斤拷

bcpow ( string $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 the scale. For example:

Example #2 bcpow() scale example

<?php
echo bcpow('5''2'2);     // prints "25", not "25.00"
?>

锟轿硷拷

  • bcpowmod() - Raise an arbitrary precision number to another, reduced by a specified modulus
  • bcsqrt() - 锟斤拷锟解精锟斤拷锟斤拷锟街的讹拷锟轿凤拷锟斤拷