The following short program will always run for 10 seconds on Windows, no matter how quickly you press ctrl+C. The program does print "Keyboard interrupt", so the signal handler does actually get run ...
Brent’s Method is a robust, efficient algorithm for finding zeros of functions, combining bisection, secant, and inverse quadratic interpolation. It is widely used in scientific computing. Adding ...