Skip to content

Conversation

@SakiTakamachi
Copy link
Member

This does not affect existing functions at all, but when comparing on BcMath\Number objects, mixing 0 and -0 will result in unintended behavior, so modify it so that the sign is always PLUS for 0 .

@cmb69
Copy link
Member

cmb69 commented Aug 27, 2024

Maybe add a test case for this?

@SakiTakamachi
Copy link
Member Author

SakiTakamachi commented Aug 27, 2024

@cmb69
There is no effect on existing functions (because the calculation results are converted to strings each time instead of being retained as a structure), so cannot write tests on the current master.

edit:
I could include this in the RFC implementation PR, but since it's already over 5000 lines, I thought it might be better to separate it other PR.

@SakiTakamachi SakiTakamachi merged commit 674ec02 into php:master Aug 27, 2024
@SakiTakamachi SakiTakamachi deleted the bcmath/fix_result_is_zero branch August 27, 2024 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants