Public Group

#### Archived

This topic is now archived and is closed to further replies.

# What up with std::sqrt()?

This topic is 5280 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey. I''m trying to use std::sqrt(), I have tried both #include <cmath> #include <math.h>. I don''t get any error such file not found, but when I try to compile anything with std::sqrt() in it I get a "error C2039: ''sqrt'' : is not a member of ''std''". I''m using VC++ 6. I of cause have a number inside the (). VC++ 6 will however in the list of std members (showing as soon as I write the second '':'') show "sqrt".

##### Share on other sites
VC++6 had a bug in its standard library where functions such as sqrt(), that were supposed to be in the std namespace, weren''t. Just use the one from the global namespace.

"Sneftel is correct, if rather vulgar." --Flarelocke

ahh, thank you.

##### Share on other sites
You can hack around it by doing something like

namespace std{using ::sqrt;}

1. 1
2. 2
3. 3
4. 4
frob
13
5. 5

• 16
• 13
• 20
• 12
• 19
• ### Forum Statistics

• Total Topics
632169
• Total Posts
3004545

×