View Single Post
  #45 (permalink)  
Old 04-25-2008, 02:55 AM
Jeyaseelansarc Jeyaseelansarc is offline
D-Web Genius
 
Join Date: Mar 2007
Location: Chennai
Posts: 1,162
Jeyaseelansarc is on a distinguished road
Send a message via AIM to Jeyaseelansarc
Default 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$b4);  // -3.7660

?>
__________________
With,
J. Jeyaseelan

Everything Possible
Reply With Quote