c++

Ouput double data with scientic precision

If you don't use the c functions to output data you can use the following code
to write stuff into the output/file


std::cout << scientic << variable << std::endl;

Blog:

Compiler Optimisation

We are doing some numeric calculations for university directly in c++, so it's as fast as possible.

One thing which makes c++ such fast are the compiler optimisations which helps to reduce the amount of code and speed things up by applying some logic.

For example

if (a + b > b)

can be converted to

if (a > 0)

You think this is a good optimisation? Often yes but in general no. Here is an example which cost me more then one day of debugging/deassembling etc.

Subscribe to RSS - c++