C/C++ Where Can I Find C++ Mathematical #Includes for Common Functions?

  • Thread starter Thread starter davidbenari
  • Start date Start date
  • Tags Tags
    C++ Mathematical
Click For Summary
C++ programming requires the use of include files for mathematical functions, which differs from languages like MATLAB. Users seeking mathematical libraries for C++ can explore options like Boost and Dlib, which offer various functionalities. While Numerical Recipes provides a comprehensive library, it requires payment. For basic trigonometric functions, the standard C99 libraries can be utilized, specifically through the inclusion of <cmath> and <cstdio>. These resources provide essential tools for performing operations such as matrix inverses and trigonometric calculations in C++.
davidbenari
Messages
466
Reaction score
18
I've just begun learning c++ and what is very different from MATLAB (e.g.) is that one has to use include files.

I was wondering if there's somewhere I can download mathematical #includes which already has stuff like matrix inverses, trigonometric functions, etc, defined.

I think numerical recipes has something like that, but you have to pay.

In python one usually uses scipy, numpy and similar stuff. But what do people that use c++ do?
 
Technology news on Phys.org
Trig functions are included in the standard C99 libraries:

Code:
#include <cmath>
#include <cstdio>

int main(int, char**){
     printf("Sin of pi: %f", sin(3.14));
     return 0;
}
 
  • Like
Likes davidbenari
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
81
Views
7K
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 17 ·
Replies
17
Views
2K
  • · Replies 17 ·
Replies
17
Views
5K
Replies
5
Views
7K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K