Top "Cmath" questions

A C++ Math library which offers basic mathematical functions of trigonometry, exponentiation, rounding etc.

Definitions of sqrt, sin, cos, pow etc. in cmath

Are there any definitions of functions like sqrt(), sin(), cos(), tan(), log(), exp() (these from math.h/cmath) available ? I …

c++ c math cmath definitions
cmath.h and compile errors

I used to work with math.h without any problem. Now, I use an external library which itself has a …

visual-studio visual-c++ compiler-errors cmath
Why are some functions in <cmath> not in the std namespace?

I am developing a project which works with multiple arithmetic types. So I made a header, where the minimal requirements …

c++ namespaces cmath
Constexpr Math Functions

So noticed from this page that none of the math functions in c++11 seems to make use of constexpr, whereas …

c++ c++11 constexpr cmath
How to fix "error: call to 'abs' is ambiguous"

I'm running a simple C++ program from HackerRank about pointers and it works fine on the website. However, when I …

c++ cmath
Why is isnan ambiguous and how to avoid it?

Since isnan can be either a macro (in C++98) or a function defined in namespace std (in C++11), an obvious (…

c++ c++11 gcc compiler-errors cmath
Using pow() gives errors

Please have a look at the following code #include <iostream> #include <iomanip> #include <cmath> …

c++ math cmath
C/C++ fastest cmath log operation

I'm trying to calculate logab (and get a floating point back, not an integer). I was planning to do this …

c++ c logarithm math.h cmath
Rounding positive/negative numbers to nearest "whole" number

I'm trying to round numbers derived from cmath's divide function to a "whole" number, the results often being negative due …

python integer python-2.x cmath
How can I work around the fact that in C++, sin(M_PI) is not 0?

In C++, const double Pi = 3.14159265; cout << sin(Pi); // displays: 3.58979e-009 it SHOULD display the number zero I understand …

c++ trigonometry cmath