|
-
July 6th, 2012, 04:23 AM
#1
[RESOLVED] Double arithmetic seems bugged
Why does this go wrong?

- Every variable here is a double, there are no ints or floats!
- App.ClientClock.CurrentTime is a double property which simply returns a double variable (it does not make any changes and there is no multithreading to make changes) so during these lines of code, this value is constant.
- I am aware of floating point inaccuracies due to approximation. This does not seem to be the issue (doubles are 64 bit floating points and a difference of 14.0 among these values is much larger than any rounding or approximation issue)
I have also tried to simplify the code by writing the following:
Code:
double ct = App.ClientClock.CurrentTime;
double newtime = ct - timeoffset;
And the same problem occurs.
The error difference changes depending on the value of CurrentTime, I've also seen differences of 10.0 and 8.0.
Solved. Answer is below.
Last edited by klapstoelpiloot; July 6th, 2012 at 08:23 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|