lcompilers / lpython

Python compiler
https://lpython.org/
Other
1.5k stars 158 forks source link

Add support for is_positive attribute #2689

Closed anutosh491 closed 4 months ago

anutosh491 commented 4 months ago

This Pr is trying to support the following case (and is also required for the gruntz algorithm)

from lpython import S

def main0():
    a: S = S(5)/S(2)
    b: S = S(-1)/S(4)
    print(a.is_positive)
    print(b.is_positive)

main0()
(lf) anutosh491@spbhat68:~/lpython/lpython$ lpython --enable-symengine examples/expr2.py 
True
False