Using the candidates test to find absolute (global) extrema