2. คำนวณ

The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

 
รหัสที่ 2-10  การใช้ตัวแปรช่วยเก็บค่าชั่วคราวที่จะใช้ซ้ำระหว่างการคำนวณ
    double tmp = Math.sqrt(b*b - 4*a*c);
    double r1 = (-b + tmp) / (2*a);
    double r2 = (-b - tmp) / (2*a);
©2009 S.Prasitjutrakul