◀ Back

Calcument - Documents that Calculate

Calcument is a unique editor designed to facilitate live math calculations using a simple, intuitive syntax. Whether you're jotting down notes with simple calculations or trying to solve complex problems, Calcument aims to make the process seamless and efficient.

Calculations are Simple in Calcument

  • Write a math expression and type the answer arrow (=>) to trigger live calculation.
  • As you change values in expressions, the answers will all update automatically.
  • Press SHIFT+ENTER at the end of any line to continue the same expression.

Predefined Functions

There are several pre-defined functions that you can use in your expressions:
Function NameDescription
minMinimum value among arguments
maxMaximum value among arguments
sqrtSquare root
roundRound to the nearest integer
floorRound down to the nearest integer
ceilRound up to the nearest integer
randomGenerate a random number
sumSum of all arguments
avgAverage of all arguments
meanSame as `avg`
medianMedian value
stddevStandard deviation
logLogarithm

Variables

  • Define variables like this, x = 4 or rent = 2000.
  • Variables can be defined while being used as parameters in functions, e.g., expenses = sum(rent=2000, car=100).
  • Valid variable names are [A-Za-z0-9_] and are case-sensitive.

Functions

  • Define your own functions for more complex calculations. Examples:
    power(base, exp) = base^exp
    double(x) = x * 2
    billion(n) = n * 10^9
As you would expect, functions can be used like any other variable or value:

Declare Speed of Light Variable

speedOfLight = 299792458 #m/s


Define Energy and Heat Functions

energy(m,c) = m*c^2

nuclearEnergyProduced(efficiency, deltaE, time) = (efficiency * deltaE) / time


Calculate Heat Produced in Nuclear Reaction

e_watts = nuclearEnergyProduced(0.33, energy(0.003, speedOfLight), 60*60*24) => 1,029,823,642.3026

e_gigawatts = e_watts/10^9 => 1.0298

Other

  • Comments start with #.
  • Press SHIFT+ENTER to create multi-line expressions.