Skip to content

Conversation

@txhsl
Copy link
Contributor

@txhsl txhsl commented Jul 3, 2024

No description provided.

@dusmart
Copy link
Collaborator

dusmart commented Jul 4, 2024

the values of (𝑎÷𝑏)÷𝑐 and 𝑎÷(𝑏×𝑐) are equal.

what multiply before divide principle state is that use (a*b)/c instead of (a/c)*b

https://math.stackexchange.com/questions/2557458/is-a-b-c-equal-to-a-bc-for-integer-division#:~:text=This%20corresponds%20to%20the%20integer,b%C3%97c)%20are%20equal.

By the way, the price for * and / are the same.

MUL: {
execute: opMul,
constantGas: GasFastStep,
minStack: minStack(2, 1),
maxStack: maxStack(2, 1),
},

DIV: {
execute: opDiv,
constantGas: GasFastStep,
minStack: minStack(2, 1),
maxStack: maxStack(2, 1),
},

I'm Ok if the auditing team insist this change. This won't bring side effect anyway.

Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

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

Well, I'm also OK with these changes. Precision loss is inevitable anyway.

@AnnaShaleva AnnaShaleva added enhancement New feature or request systemcontracts Everything related to system contracts labels Jul 4, 2024
@AnnaShaleva AnnaShaleva added this to the v0.2.0 milestone Jul 4, 2024
@AnnaShaleva
Copy link
Member

Should anyone else review this PR?

@txhsl txhsl merged commit ba2663c into bane-main Jul 4, 2024
@txhsl txhsl deleted the governance-precision-loss branch July 4, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request systemcontracts Everything related to system contracts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants