-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use International Mile for UnitLength operations #3033
Conversation
|
@swift-ci test |
|
@spevans @amomchilov I'm not 100% sure about the TestFoundation.TestMeasurement-testLoadedValuesMatch test. It uses the Will you please re-run the tests? |
|
@swift-ci test |
|
Looks like the changes allowed the tests to pass. @amomchilov @spevans |
|
@nVitius does your patch correspond to Darwin behavior? We try to keep things working 1:1 bug-for-bug where possible. |
|
@millenomi Looking through the docs, it would seem like Darwin also has this issue: I sent a report via FeedbackAssistant for now; I'm not sure where the best place to report this would be. |
Oh jeeze. That's unfortunate, but understandable. I've had better success piping my bug reports to |
|
sighs Can you post your FB number so I can pass it on internally? |
|
Pinging @nVitius, he's the one who submitted a bug report. |
|
The FB number is: |
|
Thank you. I'm going to close this for now, but it was important and I'll make sure the issue is seen so we can ultimately fix it here as well. |

I made this PR based on some conversation in this SO post. This patch changes the Coefficient for the mile to
1609.344, to be in-line with the official definition of the "international mile".From the NIST's Conversion Factor's for General Use handbook:

The existing Coefficient leads to an incorrect result. This can be seen by trying to convert 1 mile to feet (1 mile should be 5280 feet):
1 * 1609.34 / 0.3048 = 5279.9868766404199475065616797900262467191601049868766404199475065...Using the standard
1609.344instead gives5280.The Coefficients for inches, feet, and yards are all correct.