! quadr - program that calculates the quadratic formula
! Jim Crumley - 9/2003 - main program - other part ???

program quadr

  call quad(1.,3.,5.)
  call quad(1.,2.,1.)
  call quad(1.,2.,10.)

endprogram quadr


SUBROUTINE quad(a , b , c)
  REAL :: a , b , c , x1 , x2 , test , disc    
  test = b*b - 4.0*a*c
  IF (test < 0.0) THEN
     PRINT * , ' Complex Roots'
  ELSE
     disc = SQRT(test)
  ENDIF
  x1 = -(b + SIGN(disc,b)) / (2.0*a)
  x2 =  c/x1
  PRINT * , ' Roots', x1, x2
  RETURN
END SUBROUTINE quad

