I have forgotten
my Password

Or login with:

  • Facebookhttp://facebook.com/
  • Googlehttps://www.google.com/accounts/o8/id
  • Yahoohttps://me.yahoo.com
Products » Calculator »

Instant Calculator Help

The CodeCogs Instant Calculators are a simple concept of turning inanimate C/C++ functions into live programs that can be called and tested throught a web interface.

By submiting code into CodeCogs, the documentation wizard is able to determine all the input variables and the return. With the users description of each variable the CodeCogs website automatically generates an instant calculator interface. In the backend the submited code is also reviewed and considered by the CodeCogs team. Here they check the code has genuine intent (it isn't a virus or liable to produce misleading results) and if ok it is compile into a fast module that can be called in quick sucession. The calculator is then complete and will be live and visible through the website.

Using the Calculator

Usage of the calculator we hope is self explanitory:

  • If you hover the mouse cursor each input box, a yellow popup will display details of what is expected.
  • You should enter a value into each input box, defining all the parameters for the function.
  • If a parameter has a default value, then it will be shown within the input box when the calculator is loaded. To change this default just enter an alternative.
  • Some calculator have a fixed set input for a parameter. These are defined called 'enums' within C, and are shown as a drop down within the calculator. To change the value used, merely select from the list the value that is appropriate to your conditions.
  • Once all values are established, click the 'Calculate' button. The result from the calculation will be shown in the panel above.
  • If one of your parameters is incorrect or out of range, a warning message will be display where the output would normally occur.

Plotting Graph

To plot a graph, you obviously need a series of points. Most function return only a single value, therefore you need to call the function multiple time with different inputs. The changing input is establishing by defining a range within one of the input variable (anyone you choose).

A range is defined using colons. For example:

10:20 is a range going from ten to twenty (By default if the variable is of a floating point type, then we'll plot a graph with 100 points between these two values).
5:15:3 is a range with three numbers (specified by the last number) between five and fifteen, i.e. 5, 10 & 15.

If the function you are using has multiple inputs and you specify a range value for more than one of these, then the final graph will contain multiple plots. The parameter with the greatest number of points always forms the x-axis.

Having establish the set of value and at least one range for the function, the graph is created by clicking the 'Graph' button at the bottom of the instant calculator


Instead of plotting a graph, the calculator can also be used to produce a table of results. Just like a graph, at least one of the input must contain a range parameter, thereby allowing multiple outputs to be produced. See 'Plotting Graph' above for details. Once the input are established, click the 'Table' button at the bottom of the instant calculator.


The CodeCogs calculator uses a technology called AJAX to comunicate with the server and perform the calculations. This approach enables the results to be shown without the screen refreshing. For this to work, Javascript must be available and be enable. Although the calculator can be shown in a number of circumstances, including for example other websites and emails, if the end-users browser or email application does not accept Javascript then the system will not work.