Today I tried to code a bit of my school maths in PHP. Because of the fact, that I need in parts really big numbers, I use the gmplib extension and its functions. One of this functions, "gmp_mul", multiplys two numbers by each other. In general, this works fine, but if one or two of this numbers is a decimal number, the result is always zero. Example:
Code: Select all
<?php
echo '0.5*0.5 = ".gmp_strval(gmp_mul('0.5','0.5'));
?>and I don't get any error of my local webserver (lighttpd).0.5*0.5 = 0
What am I doing wrong? The description of "gmp_mul"says "Multiplies a by b and returns the result."
An overwiew of the GMP PHP functions can be found here: http://www.php.net/manual/en/ref.gmp.php
Thanks in advance for any help and please excuse my bad English, I hope I described the problem in an understandable way.
Greetings
Nexon