def _nan_equal(a, b):
 if (type(a) is not type(b)):
  return False
 if isinstance(a, float):
  return (math.isnan(a) and math.isnan(b))
 aexp = a.as_tuple()[2]
 bexp = b.as_tuple()[2]
 return ((aexp == bexp) and (aexp in ('n', 'N')))

def _nan_equal ( a , b ) : if ( type ( a ) is not type ( b ) ) : return False if isinstance ( a , float ) : return ( math . isnan ( a ) and math . isnan ( b ) ) aexp = a . as_tuple ( ) [ 2 ] bexp = b . as_tuple ( ) [ 2 ] return ( ( aexp == bexp ) and ( aexp in ( 'n' , 'N' ) ) )
return true if a and b are both the same kind of nan .