|
-
August 18th, 2007, 12:40 PM
#1
is not a member of 'std'
Hi...
It seems I'm always having problems with the std:: thing...
When I try this:
Code:
#include <limits>
using namespace std;
int main(){
double log_double_max = std::log(std::numeric_limits<double>::max());
const double log_double_min = log(numeric_limits<double>::min());
return(0);
}
I get the following error messages:
error C2039: 'log' : is not a member of 'std'
error C2589: '(' : illegal token on right side of '::'
error C2143: syntax error : missing ')' before '::'
etc...
Nevertheless, when I type std:: the object browser pops up and I see the log, numeric_limits and all the other functions.
So why do I get this error: error C2039: 'log' : is not a member of 'std' then?
Thanks for your input on this.
Niko
-
August 18th, 2007, 12:46 PM
#2
Re: is not a member of 'std'
-
August 18th, 2007, 09:22 PM
#3
Re: is not a member of 'std'
Like Zuk said, you need to include <cmath> for log function. You can find all the details of library functions and header from this link
Appreciate others by rating good posts
"Only buy something that you'd be perfectly happy to hold if the market shut down for 10 years." - Warren Buffett
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|