Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To answer your question: No, there is no way to check the flags using normal floats. You can use the Decimal class, however, which provides much more control <strong>. . .</strong> but is a bit slower.</p> <p>Your other option is to use an <code>EmptyData</code> or <code>Null</code> class, such as this one:</p> <pre><code>class NullType(object): "Null object -- any interaction returns Null" def _null(self, *args, **kwargs): return self __eq__ = __ne__ = __ge__ = __gt__ = __le__ = __lt__ = _null __add__ = __iadd__ = __radd__ = _null __sub__ = __isub__ = __rsub__ = _null __mul__ = __imul__ = __rmul__ = _null __div__ = __idiv__ = __rdiv__ = _null __mod__ = __imod__ = __rmod__ = _null __pow__ = __ipow__ = __rpow__ = _null __and__ = __iand__ = __rand__ = _null __xor__ = __ixor__ = __rxor__ = _null __or__ = __ior__ = __ror__ = _null __divmod__ = __rdivmod__ = _null __truediv__ = __itruediv__ = __rtruediv__ = _null __floordiv__ = __ifloordiv__ = __rfloordiv__ = _null __lshift__ = __ilshift__ = __rlshift__ = _null __rshift__ = __irshift__ = __rrshift__ = _null __neg__ = __pos__ = __abs__ = __invert__ = _null __call__ = __getattr__ = _null def __divmod__(self, other): return self, self __rdivmod__ = __divmod__ if sys.version_info[:2] &gt;= (2, 6): __hash__ = None else: def __hash__(yo): raise TypeError("unhashable type: 'Null'") def __new__(cls): return cls.null def __nonzero__(yo): return False def __repr__(yo): return '&lt;null&gt;' def __setattr__(yo, name, value): return None def __setitem___(yo, index, value): return None def __str__(yo): return '' NullType.null = object.__new__(NullType) Null = NullType() </code></pre> <p>You may want to change the <code>__repr__</code> and <code>__str__</code> methods. Also, be aware that <code>Null</code> cannot be used as a dictionary key, nor stored in a set.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload