More portable way to check for nan.