(computer science) A section of code, called by the main body of a program, that implements a task. While it may be used at more than one point in a program, it need not be.
Although this will not work in all cases, for example when calling the wrong subroutine, it is the easiest way to find the problem if the program uses the incorrect results of a bad mathematical calculation.