Solved

VC++ upgrade to VS.net issue

Posted on 2004-04-22
5
428 Views
Last Modified: 2010-04-24
I have downloaded this project and it was originally compiled with VC++ 6 and I converted it to VS.net 2003 project and when I compile I receive this error.

error C2668: 'log' : ambiguous call to overloaded function

Which comes from this function:

// Calculates the x having the closest 2^x value for the given value
static int _getClosest2Power(double value)
{
   return (int)(log(value) / log(2) + 0.5);
}


How can I make this work?

I am very very fresh to VC++ as I am a vb vet so the most explanations the best.

Thanks to all!
0
Comment
Question by:Sentax
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Author Comment

by:Sentax
ID: 10891560
I have figured it out.

Sorry for posting.
0
 

Expert Comment

by:moseph
ID: 10910807
Hi Sentax

if you are intending to use the LOG function,
change that line of code to this:
return (int)(Math::Log(value) / Math::Log(2) + 0.5);

hope that helps
0
 

Author Comment

by:Sentax
ID: 10912467
Well thanks moseph but if read the post right above yours I have already solved it.

I didn't use your suggestion and I don't know if yours would work but the solution I did use was:

static int _getClosest2Power(double value)
{
  return (int)(log(value) / log((double)2) + 0.5);
}
0
 
LVL 7

Expert Comment

by:leflon
ID: 10948477
hi Sentax,
please ask CS to delete this Q and refund your pts

leflon
0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 11004880
Closed, 50 points refunded.
PashaMod
Community Support Moderator
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question