Wie bekomme ich diese Fehlermeldung weg?
-
Statistic.cpp:49: call of overloaded `exp(int)' is ambiguous
/usr/include/bits/mathcalls.h:96: candidates are: double exp(double)
/usr/include/g++/cmath:229: long double std::exp(long double)
/usr/include/g++/cmath:221: float std::exp(float)mit dem zugehörigen Code:
#include "math.h" ... x=exp(...);
Muss was ganz einfaches sein ... komm aber gerade nicht drauf!
-
Es gibt mehrere überladene Versionen von exp(), einmal für double und einmal für float. Du rufst exp aber mit int auf, und jetzt weiß der Compiler nicht, welche davon er nehmen soll. Tip: Du willst double, also schreibst du exp(double(...))
-
Danke. Inzwischen hatte ich es auch selber herausgefunden ... frher lief dieser Code mal ohne Fehlermeldung durch ...
Grße, LAOES