C ++ math functions can be used without including the "math.h" directive in VS 2013

I am very curious why I can use math functions in C ++ without including "math.h". I can not find the answer with google search.

Here is a simple code that I am executing. Everything compiles and works.

#include <iostream>

using namespace std;

int main()
{
    const float PI = acosf(-1);
    cout << PI << endl;

    return 0;
}
+4
source share
2 answers

Any standard title may include any other standard title.

+6
source

if you compile the same with gcc-4.8 it will complain.

, , , , .

+3

Source: https://habr.com/ru/post/1538178/


All Articles