Skip to content

Conversation

@mununki
Copy link
Member

@mununki mununki commented Oct 7, 2024

This PR fixes the issue where max, min operations generate js ouput incorrectly. It is described in the related issue #7062 (comment)

@mununki
Copy link
Member Author

mununki commented Oct 7, 2024

Since there were no tests for max and min, it seems we were unable to identify issues during testing. Therefore, I have added the necessary tests.

@mununki mununki requested a review from cometkim October 7, 2024 02:18
| [ { expression_desc = Number (Float _) } as a; { expression_desc = Number (Float _) } as b ]
| [ { expression_desc = Number (BigInt _) } as a; { expression_desc = Number (BigInt _) } as b ]
when Js_analyzer.is_okay_to_duplicate a && Js_analyzer.is_okay_to_duplicate b ->
E.econd (E.js_comp Cgt a b) a b
Copy link
Member

Choose a reason for hiding this comment

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

Use E.bigint_comp here should improve the outputs

Copy link
Member Author

Choose a reason for hiding this comment

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

Got it, thanks. 77a4630

Copy link
Member

Choose a reason for hiding this comment

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

Hmm ok E.econd itself doesn't seem to be optimized enough yet

@mununki mununki merged commit 403f11d into master Oct 7, 2024
20 checks passed
@mununki mununki deleted the fix-bigint-max-min branch October 7, 2024 03:58
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