math.h pow function isn't working!
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.
C++ reference: cmath: pow
Looks like it takes two doubles. It should do decimals and negative powers.
Looks like it takes two doubles. It should do decimals and negative powers.
Sagar_Indurkhya: Could you please post a sample where pow() fails? It would help us to find an explanation for the unexpected behaviour.
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?
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
Cheers
Chris
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement