On 1/29/12, Cameron McCormack <cam@mcc.id.au> wrote: > Marat Tanalin: >> It would be nice to have a standard method to calculate arbitrary root >> (e.g. cube root). > > This seems to be a pure ECMAScript enhancement request, so I would > suggest raising it on the es-discuss mailing list: > I agree. I'm not that good at math, but for fun: function getCubeRoot(x) { if(x < 0) { return -Math.pow(-x, 1/3); } return Math.pow(x, 1/3); } -- Garrett Twitter: @xkit personx.tumblr.comReceived on Monday, 30 January 2012 03:22:27 UTC
This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:05 UTC