Peng Yu
9/10/2008 3:01:00 AM
On Sep 9, 9:35 pm, Sjouke Burry <burrynulnulf...@ppllaanneett.nnlll>
wrote:
> Peng Yu wrote:
> > On Sep 9, 8:29 pm, "Alf P. Steinbach" <al...@start.no> wrote:
> >> * Peng Yu:
>
> >>> Hi,
> >>> The output of the following program is
> >>> (-27.7128,16) (-9.09495e-12,32768)
> >>> Obviously, y*y*y is not equal to x, even the magnitude is off. I'm
> >>> wondering what is wrong here.
> >>> Thanks,
> >>> Peng
> >>> #include <complex>
> >>> #include <iostream>
> >>> int main () {
> >>> std::complex<double> x(2, 2);
> >>> std::complex<double> y = std::pow(x, 1/.3);
> >>> std::cout << y << " " << y * y * y << std::endl;
> >>> }
> >> The second argument to pow.
>
> > I don't quite understand what you mean. Would you please be more
> > specific?
>
> > Thanks,
> > Peng
>
> 1/.3 equals 3.333333, perhaps you meant 1./3.
I'm sorry that I could pinpoint it. Thank you.
Peng