Repository navigation
Round a spring's derived physics to ten significant figures - #148
Merged
Merged
Conversation
The duration round trip handed back 300.00000000000006 for a stiffness of 300, and the noise reached changes() and the copied values. Stiffness and damping derived from a duration now snap to ten significant figures, so given values come back exact and derived ones read cleanly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A spring tuned by stiffness converts through its duration and back, which handed back 300.00000000000006 for a stiffness of 300, so the noise showed up in changes() and the copy button's output. The stiffness and damping it derives now snap to ten significant figures: a given 300 and 20 come back exact, and derived values read as 109.6622711 rather than 109.6622711232151. The curve moves by less than a part in a billion. A new test fails without the change, and the docs snapshot differs only in those digits.