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

math: fix failing test on FreeBSD with gcc 12.2.0 (and -ffast-math) #19278

Merged
merged 17 commits into from Sep 6, 2023

Conversation

spytheman
Copy link
Member

@spytheman spytheman commented Sep 5, 2023

Both invocations below pass now on FreeBSD 13.0-RELEASE-p13:
v -fast-math -cc gcc vlib/math/math_test.v
and
v -cc gcc vlib/math/math_test.v

🤖 Generated by Copilot at 6d1f811

This pull request enhances the vlib/math module by improving the test coverage and reliability, fixing the floating-point comparison and NaN detection, and adding some debugging prints. These changes are mainly related to the -fast-math flag and its effects on the math functions.

🤖 Generated by Copilot at 6d1f811

  • Add a condition to is_nan to handle quiet NaNs with fast math (link)
  • Skip or modify some tests in math_test.v that may fail with fast math due to different behavior of acos, atan2, sign, and exp functions (link, link, link, link)
  • Remove a redundant condition in test_round that was skipping assertions involving zero (link)
  • Improve the alike function in math.v to use a more robust comparison of floating-point numbers, ignoring the last two bits of the binary representation (link)
  • Add some print statements in round and alike for debugging purposes, which should be removed before merging (link, link)

@spytheman spytheman merged commit 3e93a13 into vlang:master Sep 6, 2023
40 of 41 checks passed
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

1 participant