Skip to content

Fix vectorAngle when nan exists #65

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

Merged
merged 1 commit into from
Feb 14, 2025
Merged

Fix vectorAngle when nan exists #65

merged 1 commit into from
Feb 14, 2025

Conversation

swhitty
Copy link
Owner

@swhitty swhitty commented Feb 14, 2025

Fixes issue where some Arc segments calculate NaN which result in trap when converting to Int.

func vectorAngle() would previously return NaN if any of its arguments were NaN, this change clamps NaN to 1.0 avoiding a crash.

The drawn path segment may still be incorrect, but the program should no longer crash.

reported in: #64

Copy link

codecov bot commented Feb 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.02%. Comparing base (3f470d7) to head (f36e1d4).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #65   +/-   ##
=======================================
  Coverage   85.02%   85.02%           
=======================================
  Files          78       78           
  Lines        7191     7191           
=======================================
  Hits         6114     6114           
  Misses       1077     1077           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@swhitty swhitty merged commit 4217dec into main Feb 14, 2025
19 checks passed
@swhitty swhitty deleted the vectorAngle-nan branch April 13, 2025 08:30
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