C
Chris Stankevitz
Q1: Does c++ provide pow(int,int)?
Q2: If not, why not?
Thanks,
Chris
Q2: If not, why not?
Thanks,
Chris
Chris said:Q1: Does c++ provide pow(int,int)?
Q2: If not, why not?
Thanks,
Chris
Larry Smith said:The ISO/ANSI Std 'C' function is:
double pow(double x, double y);
This is supported by C++; just include
<math.h> or <cmath>.
Chris Stankevitz said:Q1: Does c++ provide pow(int,int)?
Q2: If not, why not?
float pow(float, float);
Ouch. So an expression like pow(2.54,2.0) is now only
single-precision.
This will cause subtle roundoff errors
in a lot of pre-existing code.
Bad, bad idea.
Steve said:Ouch. So an expression like pow(2.54,2.0) is now only
single-precision. This will cause subtle roundoff errors
in a lot of pre-existing code.
Jacek Dziedzic said:Wouldn't you need pow(2.54f,2.0f) for pow to resolve
to pow(float, float)?
osmium said:No, it has no such function.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.