Skip to content

vb: use floor for conversion, add integer tests #737

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 3 commits into from
Jun 20, 2025
Merged

vb: use floor for conversion, add integer tests #737

merged 3 commits into from
Jun 20, 2025

Conversation

drinckes
Copy link
Contributor

See issues #674 and #717.

This corrects the implementation to use floor when converting from degrees to the integer values, and adds tests for the conversion of degrees to integer, encoding from integers, and adds tolerance to the degrees encoding (due to floating point precision).

It fixes a number of differences in behaviour with other implementations. (It will now correct invalid code length values to something valid, for instance.)

@drinckes
Copy link
Contributor Author

drinckes commented Jun 20, 2025

Need to fix the tests still. Libreoffice Basic doesn't have a Floor function, so I'll need to code one (can't just cast to Int because that will round negative numbers down, not towards zero).

@drinckes drinckes merged commit 83986da into main Jun 20, 2025
35 checks passed
@drinckes drinckes deleted the vb_674_717 branch June 20, 2025 13:48
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