3 * A class for arbitrary precision math functions implemented using GMP
7 * @category PHPCryptLib
10 * @author Anthony Ferrara <ircmaxell@ircmaxell.com>
11 * @copyright 2011 The Authors
12 * @license http://www.opensource.org/licenses/mit-license.html MIT License
13 * @version Build @@version@@
15 namespace CryptLib\Core\BigMath
;
18 * A class for arbitrary precision math functions implemented using GMP
20 * @category PHPCryptLib
24 class GMP
extends \CryptLib\Core\BigMath
{
27 * Add two numbers together
29 * @param string $left The left argument
30 * @param string $right The right argument
32 * @return A base-10 string of the sum of the two arguments
34 public function add($left, $right) {
35 return gmp_strval(gmp_add($left, $right));
39 * Subtract two numbers
41 * @param string $left The left argument
42 * @param string $right The right argument
44 * @return A base-10 string of the difference of the two arguments
46 public function subtract($left, $right) {
47 return gmp_strval(gmp_sub($left, $right));