With C++, I try to
#define TINY std::pow(10,-10)
I give the code with the #include and namespace information for the class (.h) where TINY is defined
#pragma once
#include "MMath.h"
#include <string>
#include <cmath>
#include <vector>
using namespace std;
#define TINY std::pow(10,-10)
I use TINY in some function implementation in .cpp file, and TINY gives error
IntelliSense: more than one instance of overloaded function “std::pow” matches the argument list
What is right syntax?
Edit: I do agree with the commenters saying that using std::pow() in place of a literal constant is unnecessary – so for this particular problem, go with the
1.0E-10constant; my explanation of the actual error you were getting and the way to solve it still stands.This has nothing to do with your
#define.std::pow()is an overloaded function, and none of its overloads take(int, int)as arguments. You should provide arguments with types which unambiguously select an overload. Depending on the type of return value you want, you’ll probably want to select one of these overloads:which you can invoke as follows:
respectively.