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

Multiplication example does not work as expected in the marie.js simulator. #286

Closed
kishorliv opened this issue Jun 8, 2020 · 1 comment

Comments

@kishorliv
Copy link
Contributor

kishorliv commented Jun 8, 2020

The multiplication example is here.
The example takes value contained in Y as a counter for the loop, decreases it by 1 untill the counter reaches 0.

         Load Y
         Subt one
         Store Y

The multiplication fails when value in Y is negative. The loop becomes infinite.
So, -3 * 5 works. 5 * -3 doesn't!

The page for this example is removed.The link is here.
I opened a pull request for this issue here.

@kishorliv kishorliv reopened this Jun 8, 2020
auroranil added a commit that referenced this issue Jun 9, 2020
(#286) Fix multiplication when the second input(Y) is negative.
@auroranil
Copy link
Member

Good work! I have tidied up the code, and also handled the case where Y = 0, in which case outputs 0. Closing this issue.

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