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

chore: use math.hypot #1936

Merged
merged 1 commit into from
Jan 17, 2024
Merged

chore: use math.hypot #1936

merged 1 commit into from
Jan 17, 2024

Conversation

SethFalco
Copy link
Member

We have some instances where we calculate the hypotenuse from two lengths. After I replaced one of them with Math.sqrt(Math.pow, Math.pow) there was discussion that this should be changed back.

I changed back the instance I modified, and changed other instances to also use Math.hypot instead.

This should be almost the same thing, except it will now support absurdly large numbers like 1e300 better with negligible cost in performance.

Related

@SethFalco SethFalco merged commit 174e952 into svg:main Jan 17, 2024
8 checks passed
@SethFalco SethFalco deleted the chore-hypot branch January 17, 2024 22:15
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