Can I use cmath header? Why ...

Write here if you have problems with your C++ source code

Moderator: Board moderators

Post Reply
narsys
New poster
Posts: 5
Joined: Sat Jun 04, 2005 6:34 am

Can I use cmath header? Why ...

Post by narsys » Thu Jun 09, 2005 6:32 am

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.

User avatar
N|N0
New poster
Posts: 36
Joined: Tue Jan 25, 2005 10:33 pm
Location: Ljubljana, Slovenija
Contact:

Post by N|N0 » Thu Jun 09, 2005 8:51 am

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 );

sumankar
A great helper
Posts: 286
Joined: Tue Mar 25, 2003 8:36 am
Location: calcutta
Contact:

Post by sumankar » Thu Jun 09, 2005 12:09 pm

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.

Post Reply

Return to “C++”