PyCalc

Calculate better

PyCalc Help

Miscellaneous Items


This page discusses some subtleties of working with PyCalc that were not covered in the quick start.

Angle Mode

The Angle Mode determines whether the trig functions (sin(), cos(), ...) use angles in radians or degrees. You can change the mode on the Settings page, or by long-pressing the indicator (Deg or Rad) at the top of the main page.

Non-immediate Results

Most valid single-line expressions (5*3) will return a result. But some will not. For instance, the value assignment a=5*3 will set a equal to 15 within the Python environment for use later, but will not return any value to the screen. The variable a will be available for use in subsequent commands: print(a) or a*20.

Multi-line Python code is also accepted:

a = 21 * 3
b = log(a)
print("The answer is ", b)

Pressing Run will cause all the lines to execute. If multi-line code does not include any print statements then no value will be returned but the code will update the Python environment for subsequent interactions.

Also note that any result returned in such a way is treated differently than results from single-line expressions. Technically, the result is a Python string, and not a numeric value, even though the way it's displayed may look identical. As such, it's not saved in the _ variable. It is possible, however, to print out many lines.

Comments

In Python, you can use the hash (#) character to begin a comment. This can be useful in your calculations to write a reminder of what the calculation is for, for later reference. Note that a comment does not cause an otherwise single-line expression to be treated as multi-line.

Comment

PyCalc vs Python

At times it may be important to recognize the distinction between Python and PyCalc. Python is a general-purpose programming language used throughout the world by millions of people for millions of applications. PyCalc is a mobile app that uses Python as the basis for a calculator user interface.

Internationalization

When entering numbers, the Python language always uses a point (3.14) as its decimal separator. Using a decimal comma (3,14) is not supported. However, PyCalc can internationalize its results — see Result Formatting for more information.