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

Adds math opcodes #80

Open
wants to merge 6 commits into
base: v3
Choose a base branch
from
Open

Conversation

3commascapital
Copy link
Contributor

These changes print out math opcodes that take 2 inputs and push its result to the top of the stack. The list of operators and appropriate typing can be found in math2.ts. I found that it was a cleaner diff to break the switch pattern being used in opcodes/index.ts but I am willing to use it if required. I plan to add the 3 input opcodes as well. Happy to do these changes in pieces if desired.

@3commascapital 3commascapital marked this pull request as draft August 24, 2024 02:14
@3commascapital 3commascapital marked this pull request as ready for review September 3, 2024 18:43
@3commascapital 3commascapital changed the title Adds math2 opcode surfacing Adds math opcodes Sep 3, 2024
@3commascapital
Copy link
Contributor Author

3commascapital commented Sep 3, 2024

I think the main thing to discuss is the coerceMathOperations variable. currently i am hard coding it. however, this could be turned into some sort of strategy configuration from the user. I am thinking about the following for this input:

  • HEX: show all numbers as hex data
  • ABS: get all of the matching permutations in checkOperation2, sort by the deviation from zero, preferencing non negative numbers, use the lowest one
  • UINT: show all numbers as uint, don't care about ints
  • some other strategy

@3commascapital
Copy link
Contributor Author

any thoughts @zemse ?

@zemse
Copy link
Owner

zemse commented Sep 19, 2024

Sorry for the delay, I'll try to review this sooner.

@zemse zemse self-requested a review September 19, 2024 12:26
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.

2 participants