Constants

PawCalc contains a series of mathematical, physical, and chemical constants. You can access the constants through the 'const' pop-up list located at the top of the screen. The constants are taken from a memo called 'constants' in the 'PawCalc' Memo Pad category. You can use the lists in the "constants1.txt" (science), "constants2.txt" (dice), and "constants3.txt" (atomic weights) files or you can write your own list.

The memo starts with the 'constants' keyword followed by a one-word name. Then it contains a series semicolon-terminated lines. Each line starts with the name of the constant to be defined, then the equal sign, and finally an expression. The constant is assigned the value of the expression. The defining expression of a constant is evaluated whenever the name of the constant appears. Thus, if you include variables in the expression defining a constant, then that constant's value will change with the value of the variable. This behavior allows for simple functions to be defined. You cannot use constants in the definition of other constants. However, you can use functions in the definition of constants. For example, you can simulate dice with the memo below. The name 'd4' refers to a four-sided die, 'd6' to a normal six-sided die, and so on.

Example:

constants dice
d4 = trunc ( rand * 4 ) + 1;
d6 = trunc ( rand * 6 ) + 1;
d8 = trunc ( rand * 8 ) + 1;
d10 = trunc ( rand * 10 ) + 1;
d12 = trunc ( rand * 12 ) + 1;
d20 = trunc ( rand * 20 ) + 1;
Note: Regardless of the PawCalc number format setting, the numbers in the constant memo must use a dot as decimal separator and comma thousand separator.

Below are the constants defined in the "constants1.txt" file.

Name Abbr. Value (incl. unit)
Imaginary unit i 1i
Pi pi 3.14159265358979323846264338327950
e e 2.71828182845904523536028747135266
Euler's Constant euler 0.57721566490153286061
Golden Ratio golden 1.61803398874989484820458683436564
Bohr Radius a0 0.529177249e-10 m
Speed of Light in Vacuum c 299792458 m/s
Coulomb Constant Cc 8.9875517873682e9 N m²/C²
Permittivity of a Vacuum e0 8.8541878176204e-12 F/m
Elementary Charge ec 1.60217733e-19 C
Faraday's Constant F 96485.309 C/mol
Earth Acceleration due to Gravity g 9.80665 m/s2
Gravitational Constant Gc 6.67259e-11 Nm²/kg²
Planck's Constant h 6.6260755e-34 J/Hz
Boltzmann's Constant k 1.380658e-23 J/K
Permeability of a Vacuum µ0 1.2566370614359e-6 N/A²
Mass of an Electron Me 9.1093897e-31 kg
Mass of a Proton Mp 1.6726231e-27 kg
Mass of a Neutron Mn 1.6749286e-27 kg
Avogadro's Constant Na 6.0221367e23 mol-1
Molar Gas Constant R 8.314510 J/(mol*K)
Rydberg's Constant Rinf 1.0973731534e7 m-1
Atomic Mass Unit u 1.6605402e-27 kg