Skip to content

Round a spring's derived physics to ten significant figures - #148

Merged
ryankiley merged 1 commit into
mainfrom
spring-float-noise
Oct 10, 2026
Merged

ryankiley merged 1 commit into
mainfrom
spring-float-noise

Conversation

@ryankiley

Copy link
Copy Markdown
Owner

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.

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.
@ryankiley
ryankiley merged commit 85d766f into main Oct 10, 2026
2 checks passed
@ryankiley
ryankiley deleted the spring-float-noise branch October 10, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant