#*****************************************************************************80 # ## quadratic_test tests quadratic. # # Licensing: # # Copyright 2016 James P. Howard, II # # The computer code and data files on this web page are distributed under # https://opensource.org/licenses/BSD-2-Clause, the BSD-2-Clause license. # # Modified: # # 07 February 2020 # # Author: # # John Burkardt # cat ( date ( ), "\n" ) cat ( "\n" ) cat ( "quadratic_test\n" ) cat ( " ", version$version.string, "\n" ) cat ( " quadratic(a,b,c) returns the roots of a quadratic equation ax^2+bx+c=0.\n" ) source ( "/home/burkardt/public_html/r_src/quadratic/quadratic.R" ) source ( "/home/burkardt/public_html/r_src/quadratic/quadratic2.R" ) a <- 24 b <- -50 c <- -14 roots = quadratic ( a, b, c ) roots2 = quadratic2 ( a, b, c ) cat ( "\n" ) cat ( "Roots of ", a, "x^2 + ", b, "x + ", c, " = 0\n" ) print ( roots, digits = 20 ) print ( roots2, digits = 20 ) a <- 94906265.625 b <- 189812534.000 c <- 94906268.375 roots = quadratic ( a, b, c ) roots2 = quadratic2 ( a, b, c ) cat ( "\n" ) cat ( "Roots of ", a, "x^2 + ", b, "x + ", c, " = 0\n" ) print ( roots, digits = 20 ) print ( roots2, digits = 20 ) # # Terminate. # cat ( "\n" ) cat ( "quadratic_test\n" ) cat ( " Normal end of execution.\n" ) cat ( date ( ), "\n" ) quit ( )