方法一、Python2.6+,直接使用math.isnan(). >>> import math >>> x = float('nan') >>> math.isnan(x) True. 方法二、判断x是否等于它本身.
確定! 回上一頁