diff --git a/pystencils/data_types.py b/pystencils/data_types.py index ed95e80fa67560c7fafa535e9362a6a26d69dd93..6bae2da8de109085421dab6a5896f96e7bf9c3e2 100644 --- a/pystencils/data_types.py +++ b/pystencils/data_types.py @@ -143,6 +143,13 @@ class TypedSymbol(sp.Symbol): return super().is_positive + @property + def is_nonnegative(self): + if self.is_negative is False: + return True + else: + return super().is_nonnegative + @property def is_real(self): if hasattr(self.dtype, 'numpy_dtype'):