$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] multiprecision int - convert to floating type
From: John Maddock (john_at_[hidden])
Date: 2013-07-25 05:27:17
> Any suggestion how to convert a mp int (e.g., int128_t) to a float type
> (e.g.,
> double)?
The C++03 way is:
cpp_int i = 1;
i <<= 128;
double d = i.convert_to<double>();
In C++11 you can just use a static_cast (explicit convertion operator).
HTH, John.