cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
log function problem
log function problem
Jun 26, 2011 at 7:36pm UTC
clarkk
(6)
Hi guys,
i am trying to remove 'delta' from this equation:
R = (double)(c*log(k/delta)*pow((double)k, 0.5));
but when i try:
R = (double)(c*log(k)*pow((double)k, 0.5));
i keep getting error C2668: 'log' : ambiguous call to overloaded function
Any ideas on how to solve this!?
Jun 26, 2011 at 7:47pm UTC
hamsterman
(4538)
k is an integer and log has no overload for an integer argument. The compiler can't decide whether it should convert it to float or double. Write
log(
float
(k))
Jun 27, 2011 at 12:46am UTC
clarkk
(6)
Thats great, tnx hamsterman!
Topic archived. No new replies allowed.