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

ST6RI-695/696 Integer division and unary Real operator evaluation are implemented incorrectly #488

Merged
merged 3 commits into from
Jul 18, 2023

Conversation

seidewitz
Copy link
Member

This pull request fixes two bugs in the evaluation of model-level evaluable expressions:

  1. ST6RI-695 Integer division is implemented incorrectly. The org.omg.sysml.expressions.functions.DivideFunction class implemented the division of two integers using truncating Java integer division. However, the KerML IntegerFunctions::'/' function returns a Rational number is intended to not be truncating.
  2. ST6RI-696 Unary Real operator evaluation is implemented incorrectly. The org.omg.sysml.expressions.functions.ArithmeticFunction::invoke made the call unaryRealOp((Integer)y) to evaluate a unary Real operator. This should instead have been unaryRealOp((Double)x).

@seidewitz seidewitz self-assigned this Jul 18, 2023
@seidewitz seidewitz merged commit 0ca0381 into master Jul 18, 2023
2 checks passed
@seidewitz seidewitz changed the title ST6RI 695/696 Integer division and unary Real operator evaluation are implemented incorrectly ST6RI-695/696 Integer division and unary Real operator evaluation are implemented incorrectly Jul 18, 2023
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.

None yet

1 participant