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

Add missing assumptions in GHC.Real.div #2311

Closed
wants to merge 1 commit into from

Conversation

mbazzani
Copy link
Contributor

@mbazzani mbazzani commented Jul 26, 2024

Previously GHC.Real.div had the assumptions ((1 < y) => v < x ) and ((y >= 1) => v <= x). These are incorrect as written. If x = -1 and y = 2 then v = -1/2, which means v > x and contradicts both assumptions. The fixed versions are ((x > 0 && 1 < y) => v < x ) and ((x >= 0 && y >= 1) => v <= x).

@facundominguez
Copy link
Collaborator

Thanks @mbazzani! This is almost fixing #2285. How about adding some test, and using div instead of / in the spec?

@facundominguez
Copy link
Collaborator

Superseeded by #2339.

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