[libstc++] Don't throw in std::assoc_legendre for m > l

André Brand andre.j.brand@gmx.de
Sun Mar 3 21:09:00 GMT 2019


The return value specified in "8.1.2 associated Legendre polynomials"
of ISO/IEC JTC 1/SC 22/WG 21 N3060 (which is identical to the
expression in the doxygen comment of the patched function) is well-
defined for m>l: it is always zero because $ P_l(x) $ is a polynomial
of degree l.

The standard does not enforce an exception in this case because none of
the requirements in 8.1 (5) on page 11 of ISO/IEC JTC 1/SC 22/WG 21
N3060 are met.

Note: the implementation of st::assoc_legendre in Visual Studio 2017
(tested with Visual Studio 15.9.7) silently returns zero.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: assoc_legendre_mgreaterl.patch
Type: text/x-patch
Size: 3096 bytes
Desc: 
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20190303/22fe019a/attachment.bin>


More information about the Libstdc++ mailing list