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

Fractions #71

Open
HarryAnkers opened this issue Feb 10, 2018 · 1 comment
Open

Fractions #71

HarryAnkers opened this issue Feb 10, 2018 · 1 comment

Comments

@HarryAnkers
Copy link

You mention numbers "may have a fractional part", do you want this to be implemented using a divide or is the number class suppose to have a function where it self-evaluates it after lexing?

@edpickup
Copy link

If you look in src/maths_lexer.flex you see that T_NUMBER can have a decimal followed by 0 or more numbers. If you then look in include/ast/ast_primitives.hpp that a "number" is basically a double with some extra wrapping.

My interpretation of all that is a a valid number will be of the form 234 or 234. or 234.5 etc, and that the lexer / parser is happy to handle non integer values. Ie "fractional part" is represented in decimal form, I think.

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