News for hackers. Stuff that matters.
Re:Mean of two floating point numbers can be dangerous by rwmj on Sunday June 05, 2016 @04:18PM (#11842905)
Yup I think you are right -- the (fixed) code is very obscure now.
Re:Mean of two floating point numbers can be dangerous by huhtenberg on Sunday June 05, 2016 @04:52PM (#11843052)
I think it's actually quite elegant. The issue is that it always does two comparisons, even when one would suffice.
Re:Mean of two floating point numbers can be dangerous by Someone on Sunday June 05, 2016 @08:53PM (#11844004)
Depending on how the compiler computes a>b, it may be branchless, though, and I expect that to be more important on modern CPUs.