--- a/Lib/decimal.py Thu Aug 02 17:50:06 2012 -0400 +++ b/Lib/decimal.py Fri Aug 03 19:01:52 2012 +1000 @@ -1601,6 +1601,8 @@ def __float__(self): """Float representation.""" + if self.is_qnan(): + return _math.copysign(float('nan'), (-1)**self._sign) return float(str(self)) def __int__(self):