+ 1
What is different in c++?!
what is different between <cmath> and <math> ???
3 odpowiedzi
+ 24
[cmath] defines symbols in the stdnamespace, and may also define symbols in the global namespace. [math.h] defines symbols in the global namespace, and may also define symbols in the stdnamespace. if you include the former and use an unqualified symbol, it may compile with one compiler but not with another. therefore it's a good idea to use [math.h]. and in general, for such header pairs, to use the [.h] version.
@StackOverflow
+ 13
is there a <math> isn't it <math.h>
one is a c header <math.h>
one is a c++ header <cmath>
other than that I think the core functionality is the same.
Be interested to see if I am incorrect 😀