При работе над разными числодробилками, анализирующими последовательности, применяющими фильтры к картинкам, cчитающим свертки и проч, периодически возникает необходимость преобразовать массив целых чисел в массив чисел с плавающей точкой и наоборот.
На C++ это может выглядеть так
std::vector<float> to_floats(std::vector<int> input) {
std::vector<float> result(input.size());
std::transform(begin(input), end(input), begin(result), [](int x) -> float { return x; });