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

Make slice::compute return signed integers #808

Closed
wants to merge 1 commit into from

Conversation

TallJimbo
Copy link

Signed results are necessary for at least the step, which may be negative.

If unsigned results are needed for the others, this should be done with a static_cast; the result of a reintepret_cast between signed and unsigned is compiler-defined. I think it's better to just pass the ssize_t values directly to the user and let them handle a conversion to unsigned if needed.

Signed results are necessary for at least the step, which may
be negative.

If unsigned results are needed for the others, this should be
done with a static_cast; the result of a reintepret_cast
between signed and unsigned is compiler-defined.  I think it's
better to just pass the ssize_t values directly to the user
and let them handle a conversion to unsigned if needed.
@jagerman
Copy link
Member

This seems a good fit with #782.

@dean0x7d
Copy link
Member

I agree that this would work well alongside #782.

@TallJimbo Looks like there are addition conversion issues that would need to be cleaned up here.

@wjakob
Copy link
Member

wjakob commented Jun 11, 2019

Superseded by #1394

@wjakob wjakob closed this Jun 11, 2019
@Peterisfar
Copy link

How to express this "a[0:3, 0:3]" in python as c ++?

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.

5 participants