- From: Garrett Smith <dhtmlkitchen@gmail.com>
- Date: Sun, 29 Jan 2012 19:21:51 -0800
- To: Cameron McCormack <cam@mcc.id.au>
- Cc: "Marat Tanalin | tanalin.com" <mtanalin@yandex.ru>, public-script-coord@w3.org
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.com
Received on Monday, 30 January 2012 03:22:27 UTC