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

feature: add support for floating numbers #11

Merged
merged 8 commits into from
Jul 30, 2023
Merged

Conversation

GraHms
Copy link
Owner

@GraHms GraHms commented Jul 30, 2023

Closes #7
In this version of SamoraLang, we've made some significant changes to improve the handling of floating-point numbers:

Added support for floating-point numbers (real numbers), previously the language only supported integer numbers. Now, users can define variables with floating-point numbers and perform operations on them.

Improved the precision of floating-point numbers in the output. Previously, floating-point numbers were truncated after the decimal point. Now, the full precision of the input floating-point numbers is preserved in the output.

Improved the lexer to correctly identify and handle floating-point numbers.

Added the float token type in the token package to represent floating-point numbers in the abstract syntax tree (AST).

Updated the parser to parse floating-point numbers and create nodes in the AST.

Updated the evaluator to correctly handle operations on floating-point numbers.

Updated built-in functions to correctly handle floating-point numbers.

Added robust error handling for floating-point numbers. If a floating-point number can't be parsed or causes an error during computation, the language now returns a helpful error message.

These changes have significantly expanded the capabilities of SamoraLang and improved the accuracy of computations. Enjoy the new features!

@GraHms GraHms merged commit 0e428e0 into master Jul 30, 2023
1 check failed
@GraHms GraHms deleted the feat/floating-numbers branch July 30, 2023 16:24
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

Successfully merging this pull request may close these issues.

Implement float type
1 participant