downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

GMP> <bcsqrt
Last updated: Fri, 13 Nov 2009

view this page in

bcsub

(PHP 4, PHP 5)

bcsub任意精度数値の減算を行う

説明

string bcsub ( string $left_operand , string $right_operand [, int $scale ] )

left_operand から right_operand を引きます。

パラメータ

left_operand

左オペランドを表す文字列。

right_operand

右オペランドを表す文字列。

scale

このオプションパラメータを使用して、 結果の小数点以下の桁数を指定します。すべての関数で使用するデフォルトのスケールを定義するには bcscale() を使用します。

返り値

減算の結果を文字列で返します。

例1 bcsub() の例

<?php

$a 
'1.234';
$b '5';

echo 
bcsub($a$b);     // -3
echo bcsub($a$b4);  // -3.7660

?>

参考

  • bcadd() - 2つの任意精度の数値を加算する



add a note add a note User Contributed Notes
bcsub
info at DONOTSPAM dot ict-eagle dot eu
08-Aug-2009 04:43
Note that it is almost useless to put a integer higher than 6 maybe 7 in the scale parameter.

In some cases this might be needed. But for the simple souls, more than 4 is not required in most of the time.

GMP> <bcsqrt
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites