Math: n-th root, logarithm with arbitrary base

Axel Rauschmayer axel at rauschma.de
Sun Dec 18 15:49:59 PST 2011


I haven’t seen these two functions among the proposed additions for Math (should these be in a math module?):

    function nthRoot(n, x) {
        return Math.pow(x, 1/n);
    }

    function log_b(b, x) {
        return Math.log(x) / Math.log(b);
    }

Have they been considered and rejected?

Axel

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com





More information about the es-discuss mailing list