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

bug: Inconsistent sign flag for SignedInteger64 when the result is 0 in module SignedInteger64 #147

Closed
0xOutOfGas opened this issue Sep 26, 2022 · 2 comments · Fixed by #191
Labels
bug Something isn't working
Milestone

Comments

@0xOutOfGas
Copy link

If the return value of add_u64 and sub_u64 is 0, it may have a different sign flag. For example:

public fun sub_u64(num: u64, minus: SignedInteger64): SignedInteger64
sub_u64(0, -0) returns +0
sub_u64(0, +0) returns -0

public fun add_u64(num: u64, addend: SignedInteger64): SignedInteger64 
add_u64(1, -1), returns -0
add_u64(0, +0), returns +0
add_u64(0, -0), returns -0
@0xOutOfGas 0xOutOfGas added the bug Something isn't working label Sep 26, 2022
@jolestar jolestar added this to the v12 milestone Oct 11, 2022
@jolestar
Copy link
Member

jolestar commented Oct 11, 2022

Maybe this is also a bug for MoveStdlib, please check it when fixing this.

pause125 added a commit to pause125/starcoin-framework that referenced this issue Oct 30, 2022
@pause125
Copy link
Collaborator

Maybe this is also a bug for MoveStdlib, please check it when fixing this.

The module SignedInteger64 has nothing to do with MoveStdlib.

pause125 added a commit to pause125/starcoin-framework that referenced this issue Oct 31, 2022
jolestar pushed a commit that referenced this issue Oct 31, 2022
* resolve #147

* remove unnecessary conversions
nkysg pushed a commit that referenced this issue Mar 3, 2023
* resolve #147

* remove unnecessary conversions
sanlee42 pushed a commit that referenced this issue Mar 16, 2023
* resolve #147

* remove unnecessary conversions
sanlee42 pushed a commit that referenced this issue Mar 22, 2023
* resolve #147

* remove unnecessary conversions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants