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

Make unit tests pass on Windows computers #12

Merged
merged 1 commit into from
Nov 30, 2023
Merged

Conversation

marcoross
Copy link
Contributor

No description provided.

@marcoross marcoross self-assigned this Nov 30, 2023
@marcoross marcoross requested a review from hofaflo November 30, 2023 12:22
@hofaflo
Copy link
Contributor

hofaflo commented Nov 30, 2023

For future reference: On windows, the default dtype produced by np.arange with integer arguments is np.int64 on linux, but np.int32 on windows (ref). In the code snippet below, integer_part_length = -1 for an integer value, which leads to factor = 10**8. Calculating value * factor can then lead to an overflow even for a relatively small value.

length = 8
integer_part_length = str(value).find(".")
factor = 10 ** (length - 1 - integer_part_length)
round_func(value * factor) / factor

@hofaflo hofaflo merged commit b0098f0 into main Nov 30, 2023
4 checks passed
@hofaflo hofaflo deleted the fix-unit-tests-on-windows branch November 30, 2023 13:27
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.

2 participants