1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
//en.cppreference.com/w/c/error/assert.html #include <stdio.h> // uncomment to disable assert() // #define NDEBUG #include <assert.h> #include <math.h> int main(void) { double x = -1.0; assert(x >= 0.0); printf("sqrt(x) = %f\n", sqrt(x)); return 0; }