Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
Reciprocal is a container code snippet to replace all values in a container by their reciprocal (that is: 1/x) (view the wikipedia page on reciprocal).
There are multiple ways to perform Reciprocal:
#include <algorithm> |
This way is used as an answer in Exercise #9: No for-loops.
#include <vector> |
Prefer algorithms over loops [1,2].
#include <vector> |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.
This page has been created by the tool CodeToHtml