Commit b81e4138 authored by deuce's avatar deuce
Browse files

MSVCs long double does *not* have 19 significant digits which is required

to be able to accurately cast a long long int to a long double.  Replace:
(long double)x/y
WITH
(x/y)+((long double)(x%y)/y)

Can everyone look for a problem with assuming those two are interchangeable
with the second being more accurate?
parent 5eeca829
......@@ -514,7 +514,9 @@ long double DLLCALL xp_timer(void)
ret=((long double)tick.HighPart*4294967296)+((long double)tick.LowPart);
ret /= ((long double)freq.HighPart*4294967296)+((long double)freq.LowPart);
#else
ret=((long double)tick.QuadPart)/freq.QuadPart;
/* In MSVC, a long double does NOT have 19 decimals of precision */
ret=((long int)(tick.QuadPart/freq.QuadPart))
+(((long double)(tick.QuadPart%freq.QuadPart))/freq.QuadPart);
#endif
}
else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment