Re: SAS/C error?



Thomas Richter <thor@xxxxxxxxxxxxxxxxxxxxxxxxxx> writes:

> > Interesting point: What is pow(x,y) if x < 0? How does
> > one determine the sign of the result if y is not integral?
>
> Mathematically, several (up to infinity) depending on whether
> y is integer, fractional or real. These solutions are complex,
> in general, and all use the same idea:
>
> a^b = exp(log(a) * b + 2 pi i N) = cos(...) + i * sin(...)
>
> where log(a) = log(r * exp(i phi)) = log(r) + i phi
> using the polar coordinates of a. If a is real and negative, r = -a and
> phi = pi.
>
> That's of course not how the IEEE libs work. They check whether y is
> integer within the available precision, then compute x^y as (-x)^y * (+/-1)
> where the sign is -1 if y is odd, +1 otherwise. In all other cases,
> the result is a NAN.

Thanks for the info. You and Herr Stoecker seemed to have
been into the math more recently than me. I'd completely
forgotten about treating the operation as a vector. I
don't recall looking at that since I took my last EE
power class pow(2, n), n > 5, years ago.
.



Relevant Pages

  • Re: need with my sons homework please
    ... Geert van der Wulp wrote: ... > or plus infinity, depending on the sign of h ...
    (sci.math)
  • Re: 0^0: "Solving a 1200-year-old problem"
    ... This is rubbish. ... 0//0 is 1 or Infinity, depending on how you analyze the problem. ...
    (sci.math)
  • Re: Infinity focus being nothing of the sort
    ... the impression that the infinity focus setting is nothing of the sort ... and is more like 30 feet. ... Depending upon the lens's actual focal length, 30 feet might be at or ... beyond infinity for that lens. ...
    (rec.photo.digital)
  • Re: 0 * X = null?
    ... > real constant) is clearly 0. ... > +infinity) depending on whether you are approaching from the right or ...
    (sci.math)