Hello. It would be nice to have a standard method to calculate arbitrary root (e.g. cube root). Currently similar result can be achieved with Math.pow(x, 1/n) where x is source number, and n is exponent. But that does not work with negative x and returns NaN in all browsers: Math.pow(-8, 1/3) // -2 is expected, NaN is returned. So probably either Math.pow() should be improved to take negative numbers into account, or a new method like Math.root(x, n) should be added. While, of course, the issue can be _currently_ worked around with a pure-script solution taking negative numbers into account, this proposal is exactly about improving _core JavaScript functionality_ to provide _standard_ means for the purpose. Thanks.Received on Sunday, 29 January 2012 23:49:01 UTC
This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:05 UTC