2016-11-17 6 views
0

がどのように私はあなたのコード内のいくつかの構文エラーがあるブースト:: 2 cpp_intを比較する多倍精度は

boost::multipercision::uint256_t x = 100; 
boost::multipercision::uint256_t y = 50; 
if (x > y){ 
std::cout << "X is bigger than Y" <<endl; 
} else { 
std::cout << "Y is bigger than X" <<endl; 
} 

答えて

1

のような2つのcpp_int値を比較することができます値。

boost::multiprecisionは綴りませんboost::multipercision

また、if-elseブロックにはx == yのチェックが含まれている必要があります。コードでは、xとyが同じ場合はY is bigger than Xが出力されるためです。