1<?php
2/**
3 * A class for arbitrary precision math functions implemented using bcmath
4 *
5 * PHP version 5.3
6 *
7 * @category   PHPPasswordLib
8 * @package    Core
9 * @subpackage BigMath
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@@
14 */
15namespace SecurityLib\BigMath;
16
17/**
18 * A class for arbitrary precision math functions implemented using bcmath
19 *
20 * @category   PHPPasswordLib
21 * @package    Core
22 * @subpackage BigMath
23 */
24class BCMath extends \SecurityLib\BigMath {
25
26    /**
27     * Add two numbers together
28     *
29     * @param string $left  The left argument
30     * @param string $right The right argument
31     *
32     * @return A base-10 string of the sum of the two arguments
33     */
34    public function add($left, $right) {
35        return bcadd($left, $right, 0);
36    }
37
38    /**
39     * Subtract two numbers
40     *
41     * @param string $left  The left argument
42     * @param string $right The right argument
43     *
44     * @return A base-10 string of the difference of the two arguments
45     */
46    public function subtract($left, $right) {
47        return bcsub($left, $right);
48    }
49
50}