Title
Fix extra "-1" for philox_engine::max()
Status
voting
Section
[rand.eng.philox]
Submitter
Ruslan Arutyunyan

Created on 2024-09-18.00:00:00 last changed yesterday

Messages

Date: 2024-10-02.12:35:56

Proposed resolution:

This wording is relative to N4988.

  1. Modify [rand.eng.philox] as indicated:

    -1- A `philox_engine` random number engine produces unsigned integer random numbers in the closed interval [0, m]), where m = 2w − 1 and the template parameter w defines the range of the produced numbers.
Date: 2024-10-15.00:00:00

[ 2024-10-02; Reflector poll ]

Set status to Tentatively Ready after six votes in favour during reflector poll.

Date: 2024-09-18.00:00:00

There is a typo in `philox_engine` wording that makes "-1" two times instead of one for `max()` method. The reason for that typo is that the wording was originally inspired by `mersenne_twister_engine` but after getting feedback that what is written in the `philox_engine` synopsis is not C++ code, the authors introduced the m variable (as in `subtract_with_carry_engine`) but forgot to remove "-1" in the m definition.

Note: after the proposed resolution below is applied the m variable could be reused in other places: basically in all places where the `mod 2^w` pattern appears (like `subtract_with_carry_engine` does). The authors don’t think it’s worth changing the rest of the wording to reuse the m variable. If somebody thinks otherwise, please provide such feedback.

History
Date User Action Args
2024-11-19 16:09:07adminsetstatus: ready -> voting
2024-10-02 12:35:56adminsetmessages: + msg14402
2024-10-02 12:35:56adminsetstatus: new -> ready
2024-09-18 12:56:54adminsetmessages: + msg14369
2024-09-18 00:00:00admincreate