octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #45507] acos returns different results on big


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #45507] acos returns different results on big input values
Date: Tue, 09 Feb 2016 06:42:02 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.2.1

Follow-up Comment #19, bug #45507 (project octave):

Mike, I agree that we should avoid mixing C and C++ complex is probably not
desirable, but in this case it might be better than any other alternative.

We could write our function something like this:


std::complex<double>
xacos (const std::complex<double>& z)
{
#if defined (HAVE_COMPLEX_STD_ACOS)
  return std::acos (z);
#elif (HAVE_CACOS)
  _Complex double r_c99 = cacos (real (z) + imag (z) * I);

  return std::complex<double> (creal (r_c99), cimag (r_c99));
#else
   // Our best attempt?
   // We could just copy the code from the GNU C library...
#endif
}



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?45507>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]