First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Evaluation question

Please explain to me the difference in the two computations:

lin=2*x - y + 2.0;lin(x=-11/9,y=-4/9)
-2.22044604925031e-16

and

2*(-11/9)-(-4/9)+2.000000000000000000
0.000000000000000000

It has to be a floating point computation, and I'm interested only in the sign of the outcome, which is why the first example gives me trouble.

click to hide/show revision 2
No.2 Revision

Evaluation question

Please explain to me the difference in between the two computations:

lin=2*x - y + 2.0;lin(x=-11/9,y=-4/9)
-2.22044604925031e-16

and

2*(-11/9)-(-4/9)+2.000000000000000000
0.000000000000000000

It has to be a floating point computation, and I'm interested only in the sign of the outcome, which is why the first example gives me trouble.