fork download
  1. #include <iostream>
  2. #include <limits>
  3. #include <cmath>
  4.  
  5. void norm(float & score) {
  6. if(score < 0.f || score != score) score = 0.f;
  7. else if(score > 1.f) score = 1.f;
  8. }
  9.  
  10. int main() {
  11. float x = 0 / 0.;
  12. norm(x);
  13. std::cout << x << std::endl;
  14. return 0;
  15. }
Success #stdin #stdout 0s 3140KB
stdin
Standard input is empty
stdout
0