Skip to content

Conversation

@erkidonik
Copy link

Fix comment in build_sqrt function. The comment incorrectly stated value is in [0, 2**250), but this function handles u8/u16/u32/u64/u128 types where max value is 2^128. Changed to [0, 2**128).

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @erkidonik)


crates/cairo-lang-sierra-to-casm/src/invocations/int/unsigned.rs line 106 at r1 (raw file):

        // Assert root**2 is in [0, value] by asserting (value - root**2) is in [0, 2**128).
        // Since we know root**2 is in [0, 2**250) (because we asserted root is in [0, 2**125))
        // and that value is in [0, 2**128) this is enough.

this is very wrong.

@orizi
Copy link
Collaborator

orizi commented Dec 22, 2025

No response.

Closing.

@orizi orizi closed this Dec 22, 2025
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.

3 participants