Namespaces
Variants
Views
Actions

Talk:cpp/numeric/math

From cppreference.com

[edit] About -f and -l variants of functions

-f and -l variants in <cmath> corresponding to C99 variants can be found in C++17 (per P0175R1), but cppreference lacks them currently. Is it better to add new signatures to cppreference?

By the way, it seems that mathematical special functions are not overloaded in [cmath.syn]. Is it a defect or not?

-- Fruderica (talk) 03:21, 11 July 2018 (PDT)

Regarding your first question: Yes, I think we should add them. (C++14 and before also seem to indicate the presence of these functions by saying "The contents of these headers are the same as the Standard C library headers" in [c.math].)
Regarding your second question: Yes, I think it makes sense to submit a issue to lwgchair. Note that implementations diverge (std::beta(1.f,2.f) returns float with libstdc++ but returns double with MSVC STL). --D41D8CD98F (talk) 18:43, 13 July 2018 (PDT)

[edit] About adding -f and -l variants to cpprefence

Names of -f and -l variants were not present in the standard themselves until C++17 (introduced per P0175R1).

However, the C++11/14 standard indicated their presence ([c.math] 4 "The contents of these headers are the same as the Standard C library headers <math.h> and <stdlib.h> respectively, with the following changes:").

Now I am adding them to cppreference. Is it more appropriate to mark them with "since C++11" or "since C++17"? --Fruderica (talk) 02:12, 4 December 2018 (PST)

I think (since C++11) is correct despite what C++11's "Table 110 - Header <cmath> synopsis" says as it directly contradicts [c.math]/4 that you quoted. It seems even in C++03, the committee believed -f/-l were allowed because C allowed, but didn't require them back then: lwg289 --Cubbi (talk) 06:16, 4 December 2018 (PST)