Good Morning,
I developed a Vc++ DLL called by a VB program. The DLL has a function that does some operation on vectors of points(double[3])
now suppose we have two set of point S , T.
If The Vb program calls the function only one time with set of points T i get a result.
If the Vb program calls the function two time, first with set S and then with set T, the result for the set T is different from the result before.
I try to debug and the difference is a product of two double that act differently.
I have two double dx and dy and the function does:
dx2 = dx*dx
dy2 = dy*dy
with the debug strings i get:
if i call only Set T i Get
[2920]point 10--> dx: 32951.71011630935400000000 dy: 1784.60091076856500000000 dx2: 1085815199.58928420000000000000 dy2:3184800.41071599160000000000 A:1089000000.00000020000000000000 B:0.00065903420232618713 C:-272250000.00000000000000000000
with the call with set T after the call with set S:
[2920]<pre>point 10--> dx: 32951.71011630935400000000 dy: 1784.60091076856500000000 dx2: 1085815199.58928390000000000000 dy2:3184800.41071599160000000000 A:1089000000.00000000000000000000 B:0.00065903420232618702 C:-272250000.00000000000000000000
as you can see dx is the same for both the calls, but the resut dx2 is different.
in final result the difference accumulates for all the points and i get slighlty different value.
Does anybody have an idea of what is happening here?
It seems the after the first call the function is in a different state but how this can affect a product with same operands?
thank you
What I have tried:
I tried to check for memory leaking but i didn't see nothing odd.