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

[rand.eng.sub] drop no-op modulo operation #4294

Merged
merged 1 commit into from May 29, 2021

Conversation

jwakely
Copy link
Member

@jwakely jwakely commented Oct 8, 2020

The e() mod 232 operation is a no-op, because e.max() < 232.

When I raised this on the LWG reflector @CaseyCarter agreed that this is the case. We should simplify the spec by removing the noise.

The e() mod 2^32 operation is a no-op, because e.max() < 2^32.
@tkoeppe
Copy link
Contributor

tkoeppe commented Oct 8, 2020

This seems legit, though I would now start to complain that k is not defined in this paragraph. We should say something like "for k = 0, ..., 8" etc.

@zygoloid
Copy link
Member

The existing wording could be read as saying that we take ceil(w/32) modulo 2^32. I assume that's not the intent?

Regarding @tkoeppe's comment, we say we're "Set[ting] the values X-r, ..., X-1, in that order, as specified below" and then below say "To set the values Xk, ...", so I think based on that it's sufficiently clear that k takes the values -r,...,-1, in that order.

While we're here, though, the wording talks about r, s, and w, which are not defined (though r, s, and w are). If we mean the values of the template parameters, we should use code font to refer to them, or we should define the math variables as the values of the template parameters.

@tkoeppe
Copy link
Contributor

tkoeppe commented Oct 18, 2020

Regarding the non-defined maths-variables, I raised that elsewhere and @jwakely has a proposal for blanket wording somewhere.

Regarding undefined indexes: I'm OK with a bound dummy index without introduction, e.g. \sum_i x_i would be fine without a range. But I'm a lot more nervous to introduce a free, dangling variable like that.

@tkoeppe
Copy link
Contributor

tkoeppe commented Oct 18, 2020

The blanket wording is the subject of #4295.

Copy link
Member

@jensmaurer jensmaurer left a comment

Choose a reason for hiding this comment

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

Let's apply this as-is as a clear improvement / fix.

@tkoeppe tkoeppe merged commit d006a0d into cplusplus:master May 29, 2021
@jwakely jwakely deleted the rand.eng.sub-modulo-shmodulo branch January 22, 2022 09:13
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.

None yet

4 participants