Jump to content
  • Advertisement
Sign in to follow this  
Sagar_Indurkhya

math.h pow function isn't working!

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need a pow function that takes two inputs, double,double, and returns the answer. The <math.h> one can't do decimal or negative powers, which is what I am looking for. Can someone help me out? I would especially like optimized versions.

Share this post


Link to post
Share on other sites
Advertisement
Sagar_Indurkhya: Could you please post a sample where pow() fails? It would help us to find an explanation for the unexpected behaviour.

Share this post


Link to post
Share on other sites
Never mind. It works. I had to officially cast everything as double, since it was otherwise using the int function. I am gonna delete this thread after an hour or so. BTW: Does anyone know where I can find the actual code for pow?

Share this post


Link to post
Share on other sites
On my windows box with vs.net 2003 its under the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\crt\src dir or optionally the intel sub dir is where you can find "optimized" versions of some of the more popular methods.

Cheers
Chris

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!