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

Include the semantic of arithmetic operations #2

Open
meevee98 opened this issue Dec 13, 2019 · 2 comments
Open

Include the semantic of arithmetic operations #2

meevee98 opened this issue Dec 13, 2019 · 2 comments

Comments

@meevee98
Copy link
Owner

I'm converting everything to Kotlin because I was having too many problems with Null Pointer Exception with Java. #1 is the current list of what has to be done for now.
While is everything being refactored, should be good to check the current behaviour of the arithmetic operations in the semantic phase.

Arithmetic Operations:

  • Addition
    • Allowed to integer and rational operands
    • The result depends on the operands. If both are integers, the result is an integer. Otherwise, the result is rational.
  • Subtraction
    • Allowed to integer and rational operands
    • The result depends on the operands. If both are integers, the result is an integer. Otherwise, the result is rational.
  • Multiplication
    • Allowed to integer and rational operands
    • The result depends on the operands. If both are integers, the result is an integer. Otherwise, the result is rational.
  • Rational Division
    • Allowed to integer and rational operands
    • The result is always a rational value
  • Integer Division
    • Allowed to integer operands
    • The result is always an integer value
  • Modulo
    • Allowed to integer operands
    • The result is always an integer value
@Thacryba
Copy link
Collaborator

As I said in this comment, it's still missing one case related to the arithmetic operation that is the division by zero, but it is a special case and we can think of it later. What do you think?

@meevee98
Copy link
Owner Author

Since we are initially just converting what was coded in Java to Kotlin and most of the verifications is nowhere to be found in the Java version, I agree that these verifications have some priority. Once the basic refactoring has been done, we will work on it. For now, I'm just leaving it in the backlog.

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