Delphi – Direct3D and the wrong FPU state: Now() function returns a wrong value (via: StackOverflow)
Posted by jpluimers on 2013/10/31
The question datetime – Delphi Now() function returns a wrong value – Stack Overflow is similar to my article Delphi – Michael Justin had strange floating point results when his 8087 FPU Control Word got hosed.
Good that stackoverflow user Anton Zhuchkov found out the cause himself: his answer indicates the Precision Control (and rounding) part of the FPU state got hosed by wrongly initializing the Direct3D device.
I edited his answer with some extra links to documentation.
Otherwise, without that flag, all floating point operations are performed with single precision. As the
TDateTimeis a simple
Now()functions is consist of simple addition of date value to time value, it all get messed up by DirectX “smart” override.
Problem solved. It was a tricky one indeed. :)