JRS: In article <3f**********************@reader3.news.skynet.be >, seen
in news:comp.lang.javascript, Philip KOCH <ph**********@hotmail.com>
posted at Tue, 11 Nov 2003 01:57:24 :-
I'm trying to calculate the cubic root of a fonction, what syntax should I
use?
One that allows the argument to be negative.
function cubeRoot(X) {
return (X<0 ? -1 : +1) * Math.pow(Math.abs(X), 1/3) }
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.