Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug27139 034 #334

Merged
merged 4 commits into from Sep 20, 2018
Merged

Bug27139 034 #334

merged 4 commits into from Sep 20, 2018

Conversation

Labels
None yet
Projects
None yet
3 participants
@nmathewson
Copy link
Contributor

@nmathewson nmathewson commented Sep 14, 2018

No description provided.

nmathewson added 4 commits Sep 14, 2018
We use an optimized but less accurate formula for converting coarse
time differences to milliseconds on 32-bit OSX platforms, so that we
can avoid 64-bit division.

The old numbers were off by 0.4%.  The new numbers are off by .006%.

This should make the unit tests a bit cleaner, and our tolerances a
bit closer.
Multiply-then-divide is more accurate, but it runs into trouble when
our input is above INT32_MAX/numerator.  So when our value is too
large, do divide-then-multiply instead.

Fixes part of bug 27139; bugfix on 0.3.4.1-alpha.
Since we use a 32-bit approximation for millisecond conversion here,
we can't expect so much precision.

Fixes part of bug 27139; bugfix on 0.3.4.1-alpha.
@coveralls
Copy link

@coveralls coveralls commented Sep 14, 2018

Coverage Status

Coverage remained the same at 59.552% when pulling 9a90f4c on nmathewson:bug27139_034 into 3ddfd5f on torproject:maint-0.3.4.

@torproject-pusher torproject-pusher merged commit 9a90f4c into torproject:maint-0.3.4 Sep 20, 2018
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment