Header file #include<boost/multiprecision/cpp_dec_float.hpp>
->This function is used for working with float values having larger precision.
->The value of the precision is given by user given as
cpp_dec_float_100,cpp_dec_float_50,cpp_dec_float_25 which are inbuilt in boost library.
->This program is given for calculating the area of the circle with higher precision.
->As the precision value gets higher the chances of error in calculation becomes less therefor,this function is very helpful in calculation manner.
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <iostream>
int main()
{
using namespace boost::multiprecision;
cpp_dec_float_100 b =0.00000000000000000000000002088888888888888888888;
cpp_dec_float_100 d=(22/7);
cpp_dec_float_100 e=4;
cpp_dec_float_100 a;
a=(b*b*d*e);
std::cout<<a;
return 0;
}
Comments