Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fractional math example (don't break things!) #11

Open
skirpichev opened this issue Apr 15, 2021 · 3 comments
Open

Fractional math example (don't break things!) #11

skirpichev opened this issue Apr 15, 2021 · 3 comments
Assignees

Comments

@skirpichev
Copy link

You can avoid ugly workarounds (like range() case), if you wrap only integer divisions with Fraction's, like Diofant does.

@aroberge
Copy link
Owner

Very nice, thank you!

This was really just a test to show that one could perform such transformations ... but it is certainly a good idea to do it correctly, like Diofant does. Diofant looks like a nice project.

@skirpichev
Copy link
Author

skirpichev commented Apr 15, 2021 via email

@aroberge
Copy link
Owner

I think I will keep the token based transformation as an example of the weakness of this approach compared with using an AST transformation.

I've made the change but will keep this issue open as a reminder that I need to improve the documentation on these two cases - and perhaps add a parameter to select which mode to use in a console so that the AST example works like one would expect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants