<cmath> and any <cxxx> header are standard C++, meaning you have strong guarantees of what is supported in those headers and how the functions in them work, as outlined in the C++ Standard. They define a series of functions in the std namespace, and that's it.
<math.h>和任何 <xxx.h>报头都是 没有标准 C + + ,尽管每个主要实现都支持它们。然而,因为它们已经被废弃了,所以当你在你的实现中包含它们的时候,有 强保证那些头里面有什么。事实上,在某些实现中已经观察到,它们提供的函数在 <cxxx>版本中表现为 不一样。
Therefore, you should always use <cxxx> when writing C++, and qualify the names of the functions with std::, for example std::malloc.