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

change chi_squared_distribution's integer literal to floating literal #2819

Merged
merged 2 commits into from Oct 6, 2019

Conversation

EzoeRyou
Copy link
Contributor

@EzoeRyou EzoeRyou commented Apr 8, 2019

chi_squared_distribution's default constructor has delegating constructor with argument of integer literal 1. But its type supposed to be the floating point types. Other distributions use floating literals in similar cases. So the suggested change.

chi_squared_distribution's default constructor has delegating constructor with argument of integer literal `1`. But its type supposed to be the floating point types. Other distributions use floating literals in similar cases. So the suggested change.
@EzoeRyou
Copy link
Contributor Author

EzoeRyou commented Apr 8, 2019

I found the same issues on fisher_f_distribution and student_t_distribution.

@jensmaurer
Copy link
Member

I believe this change is unnecessary. RealType can only be float, double, or long double (cf. [rang.req.genl] p1.4), and RealType is not a template parameter for the constructor (it's a template parameter for the surrounding class template), so there is no template type deduction in the delegating constructor.

(Personally, I dislike source code that has "double x = 0.0" and similar all over the place; "double x = 0" is also clear and saves reading two characters. But that's just me.)

Are there other examples in the standard text where we do the equivalent of "double x = 1.0" as opposed to "double x = 1", so that we could argue with harmonization?

@zygoloid zygoloid added the decision-required A decision of the editorial group (or the Project Editor) is required. label Jun 12, 2019
@zygoloid
Copy link
Member

We should decide how we want to format floating-point literals throughout the library wording and document that decision.

@jensmaurer
Copy link
Member

Editorial meeting: Every floating-point literal in the library section should have a decimal point and at least one digit on each side of the decimal point (also 1.0e3). Only potentially apply to examples. Use digit separator for constants for random number generators in 26.6.5 (e.g. mersenne_twister). Also apply spaces after commas in that section.

@jensmaurer jensmaurer removed the decision-required A decision of the editorial group (or the Project Editor) is required. label Jul 16, 2019
@zygoloid zygoloid merged commit 8a13bc1 into cplusplus:master Oct 6, 2019
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

3 participants