# Some PCalc stuff

My PCalc setup tends to stay the same for long stretches of time—it’s a stable app, and I’ve settled into a comfortable way of using it. But I did make some small adjustments a couple of months ago and thought you might be interested.

First, I moved some of the function buttons in my customized “Drang” layout. It now looks like this with the standard and 2nd functions:

Apart from a little rearranging of the gray buttons, the main change is removing the gamma function (which I never use and had in there only because it fit as companion to the factorial) and replacing it with a combination function, yCx. It’s in the second row, third button from the left.

I say “a combination function” instead of “the combination function” because the built-in combination function, which is in the Special functions group, organizes its input and output in ways I don’t like.

Let’s say we wanted to find the number of combinations of 10 items taken 5 at a time. The input and output using the built-in combinations function look like this:

1. The inputs are in reverse order, at least according to the way I think. When I think of combinations, I always think of the total number of items first and the number chosen second. In my head are the phrases “10 items taken 5 at a time” or “10 choose 5.” So my history with the built-in combinations function has been to enter the arguments that way, get an error message, then swap the inputs and redo. I finally got fed up with this and decided that PCalc should bend to my will rather than the other way around.
2. The output is just one number, but PCalc gives me two. I can understand why James Thomson, PCalc’s developer, did it this way, because built-in functions should accommodate both Algebraic and RPN modes and there’s a symmetry to having both the input and output with numbers in the x and y registers. But I don’t use Algebraic mode, and the extraneous zero in the y register gets in the way of other items I may have further up the stack. Again, PCalc isn’t the boss of me.

So I rewrote the combinations function to fit the way I think and work. Now if I want to get the number of combinations of 10 items taken 5 at a time, I enter the 10 and 5 in that order and tap the yCx button. The input and output look like this:

Here’s James’s code for the built-in combinations function on the left and my code on the right:

As you can see, I just stole James’s code and changed the beginning and ending bits to match my preferences.

(As a side note, you can also see that PicSew, which I used to make the extended screenshot on the right, uses a slightly darker iPhone frame image than Federico Viticci’s framing shortcut, which I used for the standard screenshot on the left.)

On my iPads, PCalc is usually my Slide Over app, ready to be pulled out from the right side of the screen whenever I need to do a quick calculation.

The layout is stretched vertically a bit more than I’d like—especially on the 12.9″ iPad, as shown above—but I haven’t felt the need to customize it for this use.

I may be unusual among PCalc users in that I use it as a calculator instead of an AR gaming platform. Despite the many other options I have for crunching numbers on iOS, it’s the app I turn to most often.