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

Made bounded-int div_rem rhs - non-zero. #5713

Merged
merged 1 commit into from
Jun 5, 2024
Merged

Conversation

orizi
Copy link
Collaborator

@orizi orizi commented Jun 4, 2024

@ilyalesokhin-starkware
Copy link
Contributor

crates/cairo-lang-sierra/src/extensions/modules/bounded_int.rs line 168 at r1 (raw file):

        // Supporting only division of a non-negative number by a positive number.
        // TODO(orizi): Consider relaxing the constraint, and defining the div_rem of negatives.
        if lhs_range.lower.is_negative() || !rhs_range.lower.is_positive() {

why did you change it?

Code quote:

| !rhs_range.lower.is_positive()

Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1.
Reviewable status: all files reviewed (commit messages unreviewed), 1 unresolved discussion (waiting on @orizi)

Copy link
Collaborator Author

@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: all files reviewed (commit messages unreviewed), 1 unresolved discussion (waiting on @ilyalesokhin-starkware)


crates/cairo-lang-sierra/src/extensions/modules/bounded_int.rs line 168 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

why did you change it?

because the range now may include 0 - it just also must be NonZero.

@orizi orizi force-pushed the pr/orizi/misc/170bf0ef branch 2 times, most recently from c7cbba2 to 78dd1b9 Compare June 5, 2024 08:33
@orizi orizi changed the base branch from pr/orizi/misc/6c35f136 to main June 5, 2024 08:33
@ilyalesokhin-starkware
Copy link
Contributor

crates/cairo-lang-sierra/src/extensions/modules/bounded_int.rs line 167 at r2 (raw file):

        let rhs_range = Range::from_type(context, rhs.clone())?;
        // Supporting only division of a non-negative number by a positive number (non zero + and
        // non negative).
  • or and

Suggestion:

        // Supporting only division of a non-negative number by a positive number (non zero and
        // non negative).

Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @orizi)

Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: 2 of 3 files reviewed, all discussions resolved (waiting on @orizi)

Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 2 of 3 files reviewed, all discussions resolved (waiting on @orizi)

@orizi orizi enabled auto-merge June 5, 2024 14:36
@orizi orizi added this pull request to the merge queue Jun 5, 2024
Merged via the queue into main with commit 070f941 Jun 5, 2024
42 of 43 checks passed
@orizi orizi deleted the pr/orizi/misc/170bf0ef branch June 10, 2024 15:42
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