Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. struct quad {
  2. int a;
  3. int b;
  4. int c;
  5. }
  6.  
  7. int f(const int a, const int b, const int c, const int x){
  8. const int l = a*x*x + b*x + c;
  9. return l;
  10. }
  11.  
  12. int safe_quad_eval(const struct quad q, const int x){
  13. (f(q.a,q.b,q.c,x)>INT_MAX)||(f(q.a,q.b,q.c,x)<(-INT_MAX)) ? INT_MIN : f(q.a,q.b,q.c,x);
  14. }
  15.  
  16. int safe_quad_eval(const struct quad q, const int x){
  17. return (f(q.a,q.b,q.c,x)>INT_MAX)||(f(q.a,q.b,q.c,x)<(-INT_MAX)) ? INT_MIN : f (q.a,q.b,q.c,x);
  18. }
  19.  
  20. int safe_quad_eval(const struct quad q, const int x){
  21. return (f(q.a,q.b,q.c,x)>INT_MAX)||(f(q.a,q.b,q.c,x)<(-INT_MAX)) ? INT_MIN : f(q.a,q.b,q.c,x);
  22. }
  23.  
  24. int safe_quad_eval(const struct quad q, const int x){
  25. return (f(q.a,q.b,q.c,x)>INT_MAX)||(f(q.a,q.b,q.c,x)<(-INT_MAX)) ? INT_MIN : f(q.a,q.b,q.c,x);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement