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

feat: add bitwise builtins #21

Merged

Conversation

KeneePatel
Copy link
Contributor

added bitwise builtins

Time spent on this PR: 30 mins

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

No builtin functions for bitwise operations.

Resolves #20

What is the new behavior?

Added four functions:

  • BITWISE_AND
  • BITWISE_XOR
  • BITWISE_OR
  • BITWISE_OPERATIONS

All functions take two inputs of a bigint and outputs a bigint as well.

The first three functions do what they are expected to, and the last function returns output of all three other functions wrapped in an array.

src/builtin.ts Outdated Show resolved Hide resolved
@ClementWalter
Copy link
Owner

I've updated the repo to organizz things a bit better.

Can you

  • put the logic in Code.gs and be aware of the fact that user facing functions (capitalize BITWISE_OR for example), will be applied to cells and not bigint (e.g. BITWISE_OR(I3, I4)) so that the input may be a string or a number, but surely not a bigint

@KeneePatel KeneePatel requested a review from ClementWalter May 29, 2024 19:40
src/ui/Code.ts Outdated Show resolved Hide resolved
@KeneePatel KeneePatel requested a review from ClementWalter June 1, 2024 23:21
src/builtins/bitwise/bitwise.ts Outdated Show resolved Hide resolved
@ClementWalter ClementWalter merged commit f8f9ef7 into ClementWalter:main Jun 3, 2024
1 check passed
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.

bitwise
2 participants