Page 1 of 1

Can I use cmath header? Why ...

Posted: Thu Jun 09, 2005 6:32 am
by narsys
My English is not good (excuse me for mistakes)
I wanted to use pow function in my code I used cmath header file (#include <cmath>) but I got WA. I submitted my code several time but got WA . I wrote my own power function I got Accept Answer.

Posted: Thu Jun 09, 2005 8:51 am
by N|N0
Can you give us more details?

Perhaps you didn't presume that pow() takes and returns doubles?

Code: Select all

double  pow ( double x, double y );

Posted: Thu Jun 09, 2005 12:09 pm
by sumankar
You can use cmath if you are using C++ as the language.And one more thing
I think you will get a Compile Error rather than WA, if some library is not supported.Also pow() returns a floating point result(double), so it has to be properly rounded...maybe that was where your code got a WA.