# How to use || as a function name and apply it to calculate the equivalent resistance of parallel resistors as we typically write?

The equivalent resistance $$R_{eq}$$ of $$n$$ resistors in parallel can be calculated from this:

Would it be possible to define a function to calculate the equivalent resistance of resistors with the function name ||? I would like to apply it like this: R1 || R2, R1 || R2 || R3, or any number of parameters, and it would return the equivalent resistance.
I know how to write a standard function to calculate the equivalent resistance of parallel resistors. However, what I am seeking here is the ability to use a function named || and apply it in the manner of R1 || R2, R1 || R2 || R3, as we typically write.
Here are typical functions for calculating equivalent parallel resistance.

• Be aware that you will have to tell the operator precedence (for example should : R1+R2 || R3 be interpeted as (R1+R2) || R3 or R1+(R2 || R3) ? ), unless you use all the necessary parenthesis systematically. Apr 6 at 21:05
• @andre314 Users should add parenthesis to make it behave as they want. Thanks for clarification. Apr 6 at 21:06
• || already has a definition as the built-in function Or. Apr 6 at 21:12
• This answer has a nice list of potential candidates Apr 6 at 21:24