switch and Math.nan