fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. double calculate_q(double x)
  5. {
  6. double numerator = tan(x) - log(sqrt(sin(x) / 12 + exp(x * x - 5)));
  7. return numerator;
  8. }
  9.  
  10. int main(void)
  11. {
  12. double x = 0;
  13. double q = calculate_q(x);
  14. if (isnan(q)) return 1; //Обработка ошибки из функции
  15. printf("q = %lf\n", q);
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 5288KB
stdin
 
stdout
q = 2.500000