! Reading non-SEA input ! --------------------- ! Here we recycle the quadratic example to demonstrate working ! with old input. We use "sea_read_old" and control the error ! via the "sea_default_error" global var. This is a flexible ! control mechanism. The "_precise" suffix for the value of ! the global var is good programming practice. program test use sea_arithmetic ! Error analytic module type(sea_abs) :: a, b, c, x ! Declare our vars call sea_check_precise() ! Verify PRECISE reals exists sea_default_error = 0.1_precise ! Modify default call sea_read_old(fin, a, "Enter a: ") ! Input a call sea_read_old(fin, b, "Enter b: ") ! Input b call sea_read_old(fin, c, "Enter c: ") ! Input c call sea_write_nl(fout) ! Write a newline call sea_write_entry(fout, "a = ", a, 5) ! Echo input call sea_write_entry(fout, "b = ", b, 5) ! Echo input call sea_write_entry(fout, "c = ", c, 5) ! Echo input call sea_write_nl(fout) ! Write a newline x = (-b + sqrt(b**2 - sea_abs(4.0,0.0) * a * c)) / (sea_abs(2.0,0.0) * a) call sea_write_entry(fout, "x = ", x, 5) ! Write result call sea_write_nl(fout) ! Write a newline end program test