--- title: "rescale" --- {{< callout type="info">}} Header: `rescale.h` From: `20.9.0` {{< /callout >}} Rescales an input range. ```cpp template class rescale : public etl::unary_function ``` `TInput` The input data type. `TCompare` The functor type used to compare values to the threshold. The default is `etl::less`. --- ```cpp rescale (TInput input_min_value, TInput input_max_value, TOutput output_min_value, TOutput output_max_value) ``` **Description** Sets the rescale limits. --- ```cpp TOutput operator()(TInput value) const ``` **Description** Rescale a value. ## Example ```cpp std::array input = { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }; std::array output; etl::rescale rescale(10, 19, 40000, 41900); std::transform(input.begin(), input.end(), output.begin(), rescale); // output = 40000, 40211, 40422, 40633, 40844, 41055, 41266, 41477, 41688, 41900 ```