Multiplication between big integers and doubles
问题 I am managing some big (128~256bits) integers with gmp. It has come a point were I would like to multiply them for a double close to 1 (0.1 < double < 10), the result being still an approximated integer. A good example of the operation I need to do is the following: int i = 1000000000000000000 * 1.23456789 I searched in the gmp documentation but I didn't find a function for this, so I ended up writing this code which seems to work well: mpz_mult_d(mpz_class & r, const mpz_class & i, double d,