Some projects require specific trigonometric functions, a library for numerically solving ordinary differential equations and working with distributions and constants. All those parts of Boost.Math will be hard to fit even in a separate book. A single recipe definitely won't be enough. So, let's focus on very basic everyday-use functions to work with float types.
We'll write a portable function that checks input value for infinity and Not-a-Number (NaN) values and changes the sign if the value is negative.