На самом деле вам вообще не нужен Boost, только библиотека C, включенная в библиотеку C ++. В частности, вам нужно включить заголовок cmath:
Округлить число: ceil (): http://www.cplusplus.com/reference/clibrary/cmath/ceil/
Округлить число: этаж (): http://www.cplusplus.com/reference/clibrary/cmath/floor/
Вы можете написать свою собственную функцию округления:
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <utility>
double roundFloat(double x)
{
double base = floor( x );
if ( x > ( base + 0.5 ) )
return ceil( x );
else return base;
}
int main()
{
std::string strInput;
double input;
printf( "Type a number: " );
std::getline( std::cin, strInput );
input = std::atof( strInput.c_str() );
printf( "\nRounded value is: %7.2f\n", roundFloat( input ) );
return EXIT_SUCCESS;
}