+ 1

# When do we include cmath and when do we include math.h? Do they mean the same thing?

was trying to learn how to use pow function...

4 ответов

+ 2

thanks👍

+ 1

cmath is C++ way of including those functions like power ,squareroot,floor ect.
while math.h is the older way from the C language.
so basically they are the same

+ 1

so if math.h is an older version why do we still use it in c++..? does it have something to do with lesser compilation time or something... you know.. cuz it's got lesser functions that we could include in our program so it probably would take less time for the computer to go through all the functions and picking the function that we need?🤔..(just asking)

+ 1

cmath and math.h should give you access to the same functions. math.h works in c±+ also so that c++ compilers will more compatible with c code.