- edited description
[feature request] mod operator, like %
coming from ccalc, i find it cumbersome to write mod function name, plus parentheses too much for such a common operation
405 % 360
//instead of current
mod(450;360)
or why not, if % character is reserved for future business percentage operations, then pascal style at least:
361 mod 360
Comments (6)
-
reporter -
reporter - edited description
-
The
%
operator used to be a percentage operator. We removed it because its behavior was incoherent, and blacklisted it to prevent confusion. Also, we cannot usemod
as an operator because it's already the name of a builtin function.But I agree it would be useful to have binary operators for modulo and some bitwise operations (AND, OR, XOR, ...). I'm not sure why they don't exist already, @heldercorreia can you shed some light?
-
reporter well, then % operator can be used? it would be super nice.
Percentages would be done with specific functions (from what i saw, in android calculators, there are 2 ways to think about percentages, or multiple ways, and they require you to choose what you like as default)
-
repo owner @Teyut They don't exist yet because of priority and time management only. The functions have been there for some time now and we haven't received that many requests for operators. PRs with new justifiable operators (that don't break existing tests) are of course mostly welcome.
-
I fully support and agree. Please add a user-configurable operator"%". So that everyone can choose for themselves how this function will work.
- Log in to comment