nan/inf checks should guard against string/float arrays