Topic: Expressions
Online Help
Constants
Real
Real constants can be positive and negative integer and decimal numbers. They can include digits "0" - "9" and decimal point ".". You can also enter numbers as fractions like "3/4". However, the program will treat them as expressions (division of two numbers). You can also define numbers in floating point format: "3.4e+6". It is the same as "3.4*10^6".
All constants and variables are internally stored as "double-precision floating point" numbers. Their values are ranged from -1.7976931348623157E+308 to 1.7976931348623157E+308. If a result is out of the above interval, the program returns "-∞" or "+∞, respectively". Division by zero gives the same result, but "0/0" = "Undefined". The smallest positive number is 4.94065645841247E-324. Smaller values are rounded exactly to 0.
Complex
If you select "Complex" mode, you can use complex numbers in calculations. Otherwise, only real arithmetic is applied. Each complex number is represented by the ordered couple (a; b), where "a" is real number, and "b = |b|i" is called "imaginary". It can be written in so called algebraic form: ±a ± bi (e.g. "2 + 3i"). You can also use other forms, such as polar or exponential from, by entering the respective expressions. In Calcpad, the imaginary unit can be entered either as "i" or "1i" in case you have a variable named "i". The imaginary unit is a special number that satisfies the expression i 2 = -1.
Other number systems (Pro only)
You can enter numbers in a number system with base from 2 to 16 by adding an underscore and the base after the digits, e.g. "10001001_2" (binary), "777_8" (octal) or "0FF_16" (hexadecimal). For bases above 10, the letters "A" - "F" or "a" - "f" are used as digits. A number can also start with a letter, e.g. "FF_16". Since it looks like a variable name, only the capital letters of the base are allowed, and it is taken as a number only if there is no variable with the same name. Fractions are also supported, e.g. "101.01_2" = 5.25. The number is converted to decimal immediately, so all calculations are performed with decimal values. In the output, the base is displayed as a subscript, followed by the decimal value:
a = 100010012 = 137
Custom
You can declare any variable or function as constant (readonly) by adding "#const" before its definition. For example:
#const γ = 0.57721566490153286#const f(x) = x^2
After that, any attempt to assign a new value to the variable or new expression to the function throws an error message.