E
E
Eugene Ordinary2019-12-02 17:11:07
Programming
Eugene Ordinary, 2019-12-02 17:11:07

Multiplication of a real number by -1 occurs on a general basis, no faster than by an arbitrary number?

There are many multiplications of double numbers by -1 in the algorithm, in fact, you only need to change the sign. Multiplication of a real number by -1 occurs on a general basis, no faster than by an arbitrary real number? If so, is it possible to change the sign somehow more economically?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
res2001, 2019-12-02
@res2001

Practice here or here .
You can simply invert the most significant bit.

X
xmoonlight, 2019-12-02
@xmoonlight

There are many multiplications of double numbers by -1 in the algorithm, in fact, you only need to change the sign.
If only multiplication, then multiply positive integers, and count the sign at the very end through an even / odd number of factors: even - "+", odd - "-".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question