7. แถวลำดับ

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.

 
รหัสที่ 7-17  เมท็อดหารากของสมการ ax2 + bx + c = 0 (แบบที่ 1)
  public static void quadraticRoot(double a, double b, double c,
                                   double[] root) {
    double t = Math.sqrt(b*b - 4*a*c);
    root[0] = (-b + t)/(2*a);
    root[1] = (-b - t)/(2*a);
  }
©2009 S.Prasitjutrakul