fork download
  1. #include <stdio.h>
  2. #include <timath.h>
  3. #include <string.h>
  4. #include <kbd.h>
  5.  
  6. int _ti89, _ti92plus;
  7.  
  8. void _main (void)
  9. {
  10. ti_float a, b, c, d;
  11. char buffer[200];
  12. clrscr ();
  13. puts ("a=");
  14. a = atof (gets (buffer));
  15. puts ("b=");
  16. b = atof (gets (buffer));
  17. puts ("c=");
  18. c = atof (gets (buffer));
  19. if (is_nan (a) || is_nan (b) || is_nan (c)) return;
  20. d = fsub (fmul (b, b), fmul (FLT (4), fmul (a, c)));
  21. if (fcmp (d, ZERO) >= 0)
  22. {
  23. ti_float x1, x2;
  24. x1 = fdiv (fadd (fneg (b), sqrt (d)), fadd (a, a));
  25. x2 = fdiv (fsub (fneg (b), sqrt (d)), fadd (a, a));
  26. printf ("\nx1=%f\nx2=%f", x1, x2);
  27. }
  28. else
  29. {
  30. ti_float re, im;
  31. re = fdiv (fneg (b), fadd (a,a));
  32. im = fabs (fdiv (sqrt (fneg (d)), fadd(a, a)));
  33. printf ("\nx1=%f-%f*i\nx2=%f+%f*i", re, im, re, im);
  34. }
  35. ngetchx();
  36. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:20: fatal error: timath.h: No such file or directory
 #include <timath.h>
                    ^
compilation terminated.
stdout
Standard output is empty