Thread
:
Mathematical functions in PHP
View Single Post
#
45
(
permalink
)
04-25-2008, 02:55 AM
Jeyaseelansarc
D-Web Genius
Join Date: Mar 2007
Location: Chennai
Posts: 1,162
Re: Mathematical functions in PHP
To subtract one arbitrary precision number from another we can use bcsub()
PHP Code:
<?php
$a
=
'1.234'
;
$b
=
'5'
;
echo
bcsub
(
$a
,
$b
);
// -3
echo
bcsub
(
$a
,
$b
,
4
);
// -3.7660
?>
__________________
With,
J. Jeyaseelan
Everything Possible
Jeyaseelansarc
View Public Profile
Send a private message to Jeyaseelansarc
Find all posts by Jeyaseelansarc