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

Fix FP exception in Wordrec::angle_change (issue #4242) #4243

Merged
merged 1 commit into from
May 17, 2024

Conversation

stweil
Copy link
Contributor

@stweil stweil commented May 16, 2024

std::asin only allows arguments in [-1, 1], but rounding errors can produce values which are slightly outside of this range and which would cause a FP exception (or wrong calculation results).

Rename also the internally used function TPOINT::length to TPOINT::length2 because it calculates the square of the length.

std::asin only allows arguments in [-1, 1], but rounding errors can
produce values which are slightly outside of this range and which
would cause a FP exception (or wrong calculation results).

Rename also the internally used function `TPOINT::length` to `TPOINT::length2`
because it calculates the square of the length.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
@amitdo amitdo merged commit 74e4381 into tesseract-ocr:main May 17, 2024
7 checks passed
@amitdo
Copy link
Collaborator

amitdo commented May 17, 2024

Thanks!

@stweil stweil deleted the issue4242 branch May 19, 2024 16:31
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.

None yet

2 participants