public static Memory bcadd(Environment env, Memory left, Memory right, int scale) {
        BigDecimal bd1 = toBigDecimal(left);
        BigDecimal bd2 = toBigDecimal(right);

        BigDecimal bd = bd1.add(bd2);
        bd = bd.setScale(scale, RoundingMode.DOWN);

        return new StringMemory(bd.toPlainString());
    }
bcmath extension
http://www.php.net/manual/ru/book.bc.php
exts/jphp-zend-ext/src/main/java/org/develnext/jphp/zend/ext/standard/BCMathFunctions.java