Fix #147: xlapy2 not propagating nans
authorJulien Langou <julien.langou@ucdenver.edu>
Thu, 18 May 2017 09:09:45 +0000 (11:09 +0200)
committerJulien Langou <julien.langou@ucdenver.edu>
Thu, 18 May 2017 09:09:45 +0000 (11:09 +0200)
commita1e853bd005a2107a0a43f92782a158a9fd6e56c
tree540f91580255a5911e61e5c7cbb2c7714690cb1c
parent2f60afb4f081a02402e9b434cd6f151d847dd151
Fix #147: xlapy2 not propagating nans

xLAPY2 now returns a NaN whenever input variables X or Y are NaNs.

The previous xLAPY2 was relying on FORTRAN INTRINSIC MAX and MIN to behave in a
certain way with NaNs (i.e. return a NaN whenever X or Y are NaN) and this
behavior is not observed on some (most?) compilers.

We handle the NaN behavior of xLAPY2 by checking for NaNs at the start of the
function.

Thanks to Andreas Noack for providing report and sample code to demonstrate the
problem.
SRC/dlapy2.f
SRC/slapy2.f