I
I
Ilya Androsov2018-09-23 16:45:51
Mathematics
Ilya Androsov, 2018-09-23 16:45:51

What is the best comparison algorithm?

I have a question that I couldn't find an answer to in the search engines. It looks like this. Is it possible to compare an expression with zero without evaluating the expression? And is it even possible to compare two numbers without counting their difference? That is, is there a better algorithm? I think not, but I have no proof of this fact. Please advise where to look for the answer and if you know it, please share it with me.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Griboks, 2018-09-23
@deadpoool00

Is it possible to compare an expression with zero without evaluating the expression?

To do this, the expression must have some properties that uniquely determine its sign. We'll have to calculate these properties.
For example, a minus sign indicates that the number is less than zero. But this sign must be obtained somehow.
The parabola can "hang" above the x-axis. To do this, you need to calculate a, D.
If the expression is a square root, then it is enough to check the equality with zero.
Again, depends on the properties of these numbers.
For example, positive numbers of the same capacity can be compared bitwise from the left.
You can compare the length of binary numbers.
In short, here is proof that better algorithms exist.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question