@sonuf
The trunc function in C++ is used to truncate (remove the decimal part) of a floating-point number and return the integer part as a floating-point value.
It is available in the <cmath> header and works for float, double, and long double types