Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Extend the functionality of Xor.pm to other bitwise operations #141

Closed
koosha-- opened this Issue · 0 comments

2 participants

@koosha--

It would be nice if the user could also have a result of and/or/not bitwise operations between two numbers.

@bpaschen bpaschen referenced this issue from a commit
@bpaschen bpaschen Extended the Xor.pm Goodie to be able to use the bitwise 'and' and 'o…
…r' operators, as well as parantheses.

This is in reply to Issue #141.

Xor.pm:
- Changed the description and secondary examples to reflect the new functionality.
- Added keywords for 'and' and 'or' as well as the unicode symbols for those operators.
- Changed the split() so it produces a token list with the numbers and the operators.
- The tokens are parsed and a command string with the values and operations is created.
- Perl's eval() is used to execute the command string, and in case of success the result is returned.
- Didn't change/add to the attribution. This is my first try at Perl and I was not sure if there can be two 'github' entries for the attribution section.

Xor.t:
- Added tests for the new operations and for operations with parantheses.
- Added tests for hex and binary values.

System: OSX 10.9
Perl: Active Perl 5.18.1
b33db6c
@jagtalon jagtalon removed the Priority: Low label
@mwmiller mwmiller closed this in #615
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.