Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sqrt(int) ambiguity

marc1842frJan 12 2006 — edited Jan 16 2006
With:
CC: Sun C++ 5.8 Patch 121017-01 2005/12/11
#include <cmath>
double f(){
    return std::sqrt(2);
}
does not compile because of an ambiguity between sqrt(float) and sqrt(double). With an int instead of 2 the ambiguity is between the double and long double versions. This does not depend on Cstd/stlport4. I have patch 111721-04 (solaris 8 libm) installed.

I believe this used to work before the january patches.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 13 2006
Added on Jan 12 2006
4 comments
297 views