Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 433
  • Last Modified:

VC++ upgrade to VS.net issue

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
Sentax
Asked:
Sentax
1 Solution
 
SentaxAuthor Commented:
I have figured it out.

Sorry for posting.
0
 
mosephCommented:
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
 
SentaxAuthor Commented:
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
 
leflonCommented:
hi Sentax,
please ask CS to delete this Q and refund your pts

leflon
0
 
PashaModCommented:
Closed, 50 points refunded.
PashaMod
Community Support Moderator
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now