...
Code Block |
---|
double safe_sqrt(double x) { if (x < 0) { fprintf(stderr, "sqrt requires a nonnegative argument"); return 0;/* Handle domain / pole error */ } return sqrt (x); } |
Range Checking
...
...
...
Code Block |
---|
double safe_sqrt(double x) { if (x < 0) { fprintf(stderr, "sqrt requires a nonnegative argument"); return 0;/* Handle domain / pole error */ } return sqrt (x); } |
...
...