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 expected results for -5 raised to the -2 power and add a few more cases #19274

Merged
merged 2 commits into from Sep 5, 2023

Conversation

kimshrier
Copy link
Contributor

@kimshrier kimshrier commented Sep 5, 2023

math: fix the pow function test.

I noticed that the expected result for -5 raised to the -2 power was -0.04 which causes the test_pow case to fail. The right value should have been 0.04, not -0.04. Raising a negative number to an even negative power will always result in a positive result.

I also added -5 raised to the -1 power and -5 raised to the -3 power to test that these exponents do have negative results.

🤖 Generated by Copilot at 7ab2d35

Improve pow function tests in math_test.v. Add more negative base and exponent cases and verify output.

🤖 Generated by Copilot at 7ab2d35

  • Add more test cases for pow function with negative base and negative exponent values (link,link)

Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work.

@spytheman spytheman merged commit c126450 into vlang:master Sep 5, 2023
39 of 41 checks passed
Wertzui123 pushed a commit to Wertzui123/v that referenced this pull request Oct 8, 2023
@kimshrier kimshrier deleted the fix_math_pow_test branch November 17, 2023 01:28
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