According to the cppref page, std::fmodf was added to cmath in C++11. How is this possible though, because wouldn't this mean that cmath would break compatability with math.h previous to C++11? I'm unable to find any references that say std::fmodf was added in C++11 and was wondering where this is stated.
Thank you
It wasn't mentioned directly (although it probably should have been mentioned either in the list of functions, or explicitly omitted). The change that causes
std::fmodf
to exist is here (quote from draft N3337):Through the following rule:
C99 added fmodf. It was inherited to C++ when C++11 started referring to the standard library of C99 instead of C89.
Note, the "following changes" do not list omission of
fmodf
.This appears to have been an editorial mistake. It seems to have been fixed in C++17 by P0175 which proposes:
Sidenote:
std::fmodf
is fairly useless in C++, since you can simply usestd::fmod
instead, and that has been around since C++98.