static double naNToZero(double x) { ret isNaN(x) ? 0.0 : x; }