Page 1 of 1

NaN * 0 = 0

PostPosted: Tue Feb 04, 2014 11:12 am
by fkluknav

dgemm and many other functions assume 0 * anything = 0. They explicitly check for 0 and skip computations in that case. The obvious benefit is speed. The downside is when the matrix contains a NaN, this NaN is hidden and ignored. IEEE 754 says 0 * NaN = NaN. Some mathematical programs refuse to compile and install when they discover this during self-tests.
Does LAPACK strive for IEEE 754 compliance? Is this a bug or a feature?