Almost every standard library comes with a set of advanced math functions However, occasionally an implementation more closely tuned to your use case is needed
The problem with the CGI way is that the state of your application is bifurcated between client and server and exists in different places at different times