-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add new Bitwise Functions introduced in MS Excel 2013 #603
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
Conversation
… were added in MS Excel 2013 - BITAND() Returns a Bitwise 'And' of two numbers - BITOR() Returns a Bitwise 'Or' of two number - BITXOR() Returns a Bitwise 'Exclusive Or' of two numbers - BITLSHIFT() Returns a number shifted left by a specified number of bits - BITRSHIFT() Returns a number shifted right by a specified number of bits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comments, then it could probably be merged directly
@@ -2423,6 +2423,175 @@ public static function erfVal($x) | |||
return self::$twoSqrtPi * $sum; | |||
} | |||
|
|||
protected static function validateBitwiseArgument($value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be private to limit our API surface and make future maintenance easier. Also maybe a doc block would be nice to document types.
Also could/should the Functions::flattenSingleValue() call be part of this method ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Valid comments; and I've also tightened up the validation to handle the different responses for different errors. See my next commit.
I'm very much tempted to write a dedicated validator class, that can be called passing in the argument with a set of validation rules/responses; but that's a more significant piece of work that really needs its own PR rather than bundling with this one.
* - Added calculation engine support for the new bitwise functions that were added in MS Excel 2013 - BITAND() Returns a Bitwise 'And' of two numbers - BITOR() Returns a Bitwise 'Or' of two number - BITXOR() Returns a Bitwise 'Exclusive Or' of two numbers - BITLSHIFT() Returns a number shifted left by a specified number of bits - BITRSHIFT() Returns a number shifted right by a specified number of bits
This is:
Checklist:
Why this change is needed?
This change provides the new Bitwise functions that were introduced in MS Excel 2013 for the calculation engine.