I have a small 3D vector class in C# 3.0 based on struct that uses double as basic unit.
An example: One vector\'s y-value is
-20.0 straight
<
Yes, I believe the result can be thread-dependent.
My guess is you're using DirectX at some point in your code - and that sets the precision for the FPU, and I believe it sets it on a per-thread basis.
To fix this, use the D3DCREATE_FPU_PRESERVE flag when you call CreateDevice
. Note that this will potentially have a performance impact. The managed equivalent is CreateFlags.FpuPreserve.
(See this related question. I haven't suggested that this one be closed as a duplicate, as they at least look a bit different on the surface. Having both should help the answer to be discoverable.)