whay it gives me NAN
HTML Code:
Math.pow(-.39,0.33);
actually here var cube2 value is giving NAN

HTML Code:
function solve_cube(){
	var m=document.getElementById("gets");
	var n=document.getElementById("divs");
	n.style.display="none";
	var a=prompt("put coeff of x^3");
	var b=prompt("put coeff of x^2");
	var c=prompt("put coeff of x");
	var d=prompt("put value of d");
	var front=(-b/(3*a));
	var three=2*Math.pow(b,3)-(9*a*b*c)+27*(a*a)*d;
	var last=Math.pow((b*b-3*a*c),3);
	var under_root=(three*three)-(4*last);
	var root=Math.sqrt(under_root);
	var for_cube_root1=(1/2)*(three+root);
	var for_cube_root2=(1/2)*(three-root);
	alert(for_cube_root1);
	var cube1=Math.pow(for_cube_root1,0.33);
	var cube2=Math.pow(for_cube_root2,0.33);
	cube1=(1/(3*a))*cube1;
	cube2=(1/(3*a))*cube2;

	var x1=front-cube1-cube2;
	
	m.value="x1 = "+x1;
	
	}