问题很简单直接,但是我在documentation上找不到答案。 .如果我有
mpfr_t a, b;
我可以做类似的事情吗
mpfr_add(a, a, b, rnd);
这将计算a
和b
的总和并将结果存储在a
中。我不知道这是否会导致别名问题,可能使结果无效,或者这是否正常。
最佳答案
没关系,它在链接文档的第 4.3 节中。
MPFR allows you to use the same variable for both input and output in the same expression. For example, the main function for floating-point multiplication, mpfr_mul, can be used like this: mpfr_mul (x, x, x, rnd). This computes the square of x with rounding mode rnd and puts the result back in x.
关于c++ - 我可以使用 `mpfr_t` 作为输入和输出参数吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42436447/