public static String bcsub(Environment env, Memory left, Memory right, int scale){
        BigDecimal bd1 = toBigDecimal(left);
        BigDecimal bd2 = toBigDecimal(right);
        return bd1.subtract(bd2).setScale(scale, RoundingMode.DOWN).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