BCCOMP(3) 1 BCCOMP(3)bccomp - Compare two arbitrary precision numbersSYNOPSIS
int bccomp (string $left_operand, string $right_operand, [int $scale = int])
DESCRIPTION
Compares the $left_operand to the $right_operand and returns the result as an integer.
PARAMETERS
o $left_operand
- The left operand, as a string.
o $right_operand
- The right operand, as a string.
o $scale
- The optional $scale parameter is used to set the number of digits after the decimal place which will be used in the comparison.
RETURN VALUES
Returns 0 if the two operands are equal, 1 if the $left_operand is larger than the $right_operand, -1 otherwise.
EXAMPLES
Example #1
bccomp(3) example
<?php
echo bccomp('1', '2') . "
"; // -1
echo bccomp('1.00001', '1', 3); // 0
echo bccomp('1.00001', '1', 5); // 1
?>
PHP Documentation Group BCCOMP(3)
Check Out this Related Man Page
BCPOW(3) 1 BCPOW(3)bcpow - Raise an arbitrary precision number to anotherSYNOPSIS
string bcpow (string $left_operand, string $right_operand, [int $scale])
DESCRIPTION
Raise $left_operand to the power $right_operand.
PARAMETERS
o $left_operand
- The left operand, as a string.
o $right_operand
- The right operand, as a string.
o $
scale -This optional parameter is used to set the number of digits after the decimal place in the result. You can also set the
global default scale for all functions by using bcscale(3).
RETURN VALUES
Returns the result as a string.
EXAMPLES
Example #1
bcpow(3) example
<?php
echo bcpow('4.2', '3', 2); // 74.08
?>
NOTES
Note
bcpow(3) 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(3) scale example
<?php
echo bcpow('5', '2', 2); // prints "25", not "25.00"
?>
SEE ALSO bcpowmod(3), bcsqrt(3).
PHP Documentation Group BCPOW(3)
Hi all,
I would like to know if I can send unix mail to 'external email addresses'.
My unix server is leo@ABCcompany.com.
I am able to send emails to firstname.lastname@ABCcompany.com.
But, we have some email addresses in our team on our parent company's server - ex:... (2 Replies)
Hi,
I need to get multiple files from an ftp server. Once the files have been downloaded, I need to move them to a different directory on the ftp server. I don't know of a command that would enable me to get a file and then move it (assuming I don't know the exact file name) within ftp. I think... (10 Replies)
I am trying to use this old post from bbabr about ftp and I am running into a little snag with the second part of the todo.lst.
for some reason the password is not being accepted. Here is the original code that was posted here some years back.
I am having problems with this piece so far: echo... (0 Replies)
Hi All,
I am trying to execute the following tar command with two --exclude options to suppress extract of the two directories specified.
Do I need to single quote the directory paths ??
Many thanks for your help.
The relevant code excerpt from the script is:
cd /var/www/${SITE}
... (7 Replies)
I am fairly green using awk so I don't have anything started but what I am trying to do is: I have a file called "contacts" and in the file are 3 fields separate by ;. I want to read each line and send an email script. I have the email function working but just need to know how to setup awk to... (8 Replies)