[AMPL 24943] How to Make a equation hold the exact value?

Hi, in model which i’m working, it has equations like this:

m5… ((x[2]-x[1])(y[2]-y[1]))+((x[3]-x[2])(y[3]-y[2]))=(0);

when i solve it, i get results like this: 1.3085e-11

Any idea how can i get the exact value of zero?

Thank you

MGB.mod (1.98 KB)

MGB.run (386 Bytes)

Because there are only a finite number of bits used to store each number in the computer, only certain special numbers can be represented exactly. As a result, it is often not possible to solve equations exactly.

To deal with this situation, solvers accept an equation as being satisfied if the difference between the two sides is less than some small “tolerance” value. A typical value for the tolerance is 1.0e-06, much larger than the 1.3085e-11 that you are seeing.

Also in any optimization application, a value as small as 1.3085e-11 would not have any practical significance, and would be regarded by anyone using the application as being effectively the same as zero.