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.
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()을 사용하여 모든 함수에 대한 전역 기본값을 설정할 수 있습니다.
반환값
뺄셈의 결과, 문자열.
예제
Example #1 bcsub() 예제
<?php
$a = '1.234';
$b = '5';
echo bcsub($a, $b); // -3
echo bcsub($a, $b, 4); // -3.7660
?>
bcsub
info at DONOTSPAM dot ict-eagle dot eu
07-Aug-2009 07:43
07-Aug-2009 07:43
