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

        BigDecimal bd = bd1.multiply(bd2);

        // odd php special case for 0, scale is ignored:
        if (bd.compareTo(BigDecimal.ZERO) == 0) {
            if (scale > 0)
                return new StringMemory("0.0");
            else
                return new StringMemory("0");
        }

        bd = bd.setScale(scale, RoundingMode.DOWN);
        bd = bd.stripTrailingZeros();

        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