1QALC(1)                     General Commands Manual                    QALC(1)
2
3
4

NAME

6       qalc - Powerful and easy to use command line calculator
7

SYNOPSIS

9       qalc [options] [expression]
10

DESCRIPTION

12       Qalculate!  is a multi-purpose cross-platform desktop calculator. It is
13       simple to use but provides power and versatility normally reserved  for
14       complicated  math  packages, as well as useful tools for everyday needs
15       (such as currency conversion and percent calculation). Features include
16       a  large  library of customizable functions, unit calculations and con‐
17       version, physical constants, symbolic calculations (including integrals
18       and  equations), arbitrary precision, uncertainty propagation, interval
19       arithmetic, plotting, and a user-friendly interface.  qalc is the  com‐
20       mand line interface of Qalculate!.
21

OPTIONS

23       -b, --base base
24               set the number base for results and, optionally, expressions
25
26       -c, --color
27               use  colors to hightlight different elements of expressions and
28               results
29
30       -e, --exrates
31               update exchange rates
32
33       -f, --file file
34               execute commands from a file first
35
36       -h, --help
37               display this help and exits
38
39       -i, --interactive
40               start in interactive mode
41
42       -l, --list [search term]
43               displays a list of  all  user-defined  or  matching  variables,
44               functions, units, and prefixes.
45
46       --list-functions [search term]
47               displays a list of all or matching functions.
48
49       --list-prefixes [search term]
50               displays a list of all or matching prefixes.
51
52       --list-units [search term]
53               displays a list of all or matching units.
54
55       --list-variables [search term]
56               displays a list of all or matching variables.
57
58       -m, --time milliseconds
59               terminate  calculation  and  display  of result after specified
60               amount of time
61
62       -n, --nodefs
63               do not load any functions, units, or variables from file
64
65       --nocurrencies
66               do not load any global currencies from file
67
68       --nodatasets
69               do not load any global data sets from file
70
71       --nofunctions
72               do not load any global functions from file
73
74       --nounits
75               do not load any global units from file
76
77       --novariables
78               do not load any global variables from file
79
80       -p [base]
81               start in programming mode (same as -b "base  base"  -s  "xor^",
82               with base conversion)
83
84       -s, --set "option value"
85               as  set command in interactive program session (ex. --set "base
86               16")
87
88       -t, --terse
89               reduce output to just the result of the input expression
90
91       -/+u8   switch unicode support on/off
92
93       -v, --version
94               show application version and exit
95
96       The program will start in interactive mode if no expression and no file
97       is specified (or interactive mode is explicitly selected).
98

COMMANDS

100       approximate
101               Equivalent to set approximation try exact.
102
103       assume assumptions
104               Set  default  assumptions  for unknown variables (unknown, non-
105               zero, positive, negative, non-positive, non-negative +  number,
106               real, rational, integer).
107
108       base base
109               Sets the result number base (equivalent to set base).
110
111       delete name
112               Removes  the  user-defined variable or function with the speci‐
113               fied name.
114               Example: delete var1.
115
116       exact   Equivalent to set approximation exact.
117
118       expand  Expands the current result.
119
120       exrates Downloads current exchange rates from the Internet.
121
122       factor  Factorizes the current result.
123
124       find, list [name]
125               Displays a list of variables, functions and units.  Enter  with
126               argument  'currencies',  'functions',  'variables', 'units', or
127               'prefixes' to show a list of all currencies,  functions,  vari‐
128               ables, units, or prefixes. Enter a search term to find matching
129               variables, functions, units, and/or  prefixes.  If  command  is
130               called with no argument all user-definied objects are listed.
131               Example: list functions.
132               Example: find dinar.
133               Example: find variables planck.
134
135       function name expression
136               Creates  a function with the specified name and expression. Use
137               '\x', '\y', '\z', '\a', etc. for arguments in the expression.
138               Example: function func1 5*\x.
139
140       help [command]
141
142       info    Displays information about a function, variable, unit, or  pre‐
143               fix.
144               Example: info sin.
145
146       MC/MS/M+/M-
147               Memory  operations  (memory  clear,  memory store, memory plus,
148               memory minus). Recall the memory using the MR/MRC variable.
149
150       mode    Displays the current mode.
151
152       partial fraction
153               Applies partial fraction decomposition to the current result.
154
155       save, store name [category] [title]
156               Saves the current result in a variable with the specified name.
157               You  may  optionally  also  provide a category (default "Tempo‐
158               rary") and a title.  If name equals  "mode"  or  "definitions",
159               the current mode and definitions, respectively, will be saved.
160               Example: store var1.
161
162       save definitions
163
164       save mode
165
166       set option value
167
168       to, convert, -> unit/"to"-command
169               Converts  the  previous result. Equivalent to using "to" at the
170               end of an expression.  Example: to m/s
171               Example: to bin
172
173       variable name expression
174               Create a variables with the specified name and expression.
175               Example: variable var1 pi / 2.
176
177       quit/exit
178               Terminates the program.
179
180       Commands for RPN mode:
181
182       rpn state
183               (De)activates the Reverse Polish  Notation  stack  and  syntax.
184               "syntax"  activates only the RPN syntax and "stack" enables the
185               RPN stack.
186
187       stack   Displays the RPN stack.
188
189       clear stack
190               Clears the entire RPN stack.
191
192       copy [index]
193               Duplicates a value on the RPN stack to the top of the stack. If
194               no  index  is  specified,  the  top of the stack is duplicated.
195               Index 1 is the top of stack and negative  index  values  counts
196               from the bottom of the stack.
197
198       move index 1 index 2
199               Changes  the  position  of a value on the RPN stack. Index 1 is
200               the top of stack and negative index values counts from the bot‐
201               tom of the stack.
202               Example: move 2 4
203
204       pop [index]
205               Removes  the top of the RPN stack or the value at the specified
206               index. Index 1 is the top of stack and  negative  index  values
207               counts from the bottom of the stack.
208
209       rotate [direction]
210               Rotates the RPN stack up (default) or down.
211
212       swap [index 1] [index 2]
213               Swaps position of values on the RPN stack. If no index is spec‐
214               ified, the values on the top of the stack (index 1 and index 2)
215               will  be  swapped and if only one index is specified, the value
216               at this index will be swapped with the top value.  Index  1  is
217               the top of stack and negative index values counts from the bot‐
218               tom of the stack.
219               Example: swap 2 4
220
221       When a line begins with '/', the text that  follows  is  always  inter‐
222       preted as a command.
223

KEYBINDINGS

225       Tab     shows  a  list  of functions, variables, and units that matches
226               the last object in the current expression
227
228       Ctrl+D  terminates the program
229
230       Ctrl+E  switches between approximation modes (exact, try exact, auto)
231
232       Ctrl+F  switches between fraction modes (simple, decimal, auto)
233
234       Ctrl+A  saves the current result in a temporary variable
235

SETTINGS

237       These settings are changed using the set command (e.g. set base 16)  or
238       the  -s,  --set  command line option (e.g. qalc -s "base 16"). Possible
239       values are shown in parenthesis. 1 and 0 can be used instead of on  and
240       off.  If  the value is left out, a value of 1 is generally assumed. The
241       default value is marked with '*'.
242
243       Algebraic mode:
244
245       algebra mode, alg (1* = expand, 2 = factorize)
246               Determines if the expression is factorized or not after  calcu‐
247               lation.
248
249       assume nonzero denominators, nzd (on*, off)
250               Determines if unknown values will be assumed non-zero (x/x=1).
251
252       warn nonzero denominators, warnnzd (on*, off)
253               Display a message after a value has been assumed non-zero.
254
255       assumptions, ass (unknown*, non-zero, positive, negative, non-positive,
256       non-negative + number, real*, rational, integer)
257               Default assumptions for unknown variables.
258
259       Calculation:
260
261       angle unit, angle (0 = none, 1* = radians, 2 = degrees, 3 = gradians)
262               Default angle unit for trigonometric functions.
263
264       approximation, appr (-1* = auto, 0 = exact, 1 = try exact, 2 = approxi‐
265       mate, 3 = dual)
266               How  approximate  variables  and  calculations  are handled. In
267               exact mode approximate values will not be calculated.
268
269       interval arithmetic, ia (on*, off)
270               If activated, interval arithmetic determines the  final  preci‐
271               sion  of  calculations (avoids wrong results after loss of sig‐
272               nificance) with approximate functions  and/or  irrational  num‐
273               bers.
274
275       interval  calculation,  ic  (1* = variance formula, 2 = interval arith‐
276       metic)
277               Determines the method used for interval  calculation  /  uncer‐
278               tainty propagation.
279
280       precision, prec (> 0) 10*
281               Specifies  the  default  number of significant digits displayed
282               and determines the precision used for approximate calculations.
283
284       Enabled objects:
285
286       calculate functions, calcfunc (on*, off)
287
288       calculate variables, calcvar (on*, off)
289
290       complex numbers, cplx (on*, off)
291
292       functions, func (on*, off)
293
294       infinite numbers, inf (on*, off)
295
296       units (on*, off)
297
298       unknowns (on, off*)
299               Interprete undefined symbols in expressions  as  unknown  vari‐
300               ables.
301
302       variables, var (on*, off)
303
304       variable units, varunit (on*, off)
305               If  activated  physical  constants  include  units  (e.g.  c  =
306               299 792 458 m∕s).
307
308       Generic display options:
309
310       abbreviations, abbr (on*, off)
311               Use abbreviated names for units and variables.
312
313       color (0 = off, 1* = default, 2 = light)
314               Use colors to highlight different elements of  expressions  and
315               results.
316
317       division sign, divsign (0* = /, 1 = division slash, 2 = division sign)
318
319       excessive parentheses, expar (on, off*)
320
321       minus last, minlast (on, off*)
322               Always place negative values last.
323
324       multiplication  sign, mulsign (0 = *, 1 = multiplication dot, 2* = mul‐
325       tiplication x, 3 = middle dot)
326
327       short multiplication, shortmul (on*, off)
328
329       spacious, space (on*, off)
330               Add extra space around operators.
331
332       spell out logical, spellout (on*, off)
333
334       unicode, uni (on*, off)
335               Display Unicode characters.
336
337       Numerical display:
338
339       base (-1114112 - 1114112, bin, oct, dec*, hex, sexa, time, roman)
340
341       base display, basedisp (0 = none, 1* = normal, 2 = alternative)
342
343       complex form, cplxform (0* = rectangular, 1 = exponential, 2 = polar, 3
344       = cis, 4 = angle)
345
346       decimal comma (locale*, off, on)
347               Determines the default decimal separator.
348
349       digit grouping, group (0* = off, 1 = standard, 2 = locale)
350
351       fractions,  fr  (-1* = auto, 0 = off, 1 = exact, 2 = on, 3 = mixed, 4 =
352       long, 5 = dual)
353               Determines how rational numbers are displayed (e.g. 5/4 =  1  +
354               1/4 = 1.25). 'long' removes limits on the size of the numerator
355               and denonimator.
356
357       hexadecimal two's, hextwos (on, off*)
358               Enables two's complement representation for display of negative
359               hexadecimal numbers.
360
361       imaginary j, imgj (on, off*)
362               Use  'j'  (instead  of 'i') as default symbol for the imaginary
363               unit.
364
365       interval display, ivdisp (0* = adaptive, 1 = significant, 2 = interval,
366       3 = plusminus, 4 = midpoint, 5 = upper, 6 = lower)
367
368       lowercase e, lowe (on, off*)
369               Use lowercase e for E-notation (5e2 = 5 * 10^2).
370
371       lowercase numbers, lownum (on, off*)
372               Use lowercase letters for number bases > 10.
373
374       max decimals, maxdeci (off*, >= 0)
375
376       min decimals, mindeci (off*, >= 0)
377
378       round to even, rndeven (on, off*)
379               Determines  whether  halfway  numbers  are  rounded  upwards or
380               towards the nearest even integer.
381
382       scientific notation, exp (0 = off, -1 = auto*, -3 =  engineering,  1  =
383       pure, 3 = scientific, >= 0)
384               Determines  how  scientific notation are used (e.g. 5 543 000 =
385               5.543E6).
386
387       show ending zeroes, zeroes (on*, off)
388               If actived, zeroes are kept at the end of approximate numbers.
389
390       two's complement, twos (on*, off)
391               Enables two's complement representation for display of negative
392               binary numbers.
393
394       Parsing:
395
396       caret as xor, xor^ (on, off*)
397               Use ^ as bitwise exclusive OR operator.
398
399       decimal comma (locale*, off, on)
400               Determines the default decimal separator.
401
402       ignore comma (on, off*)
403               Allows use of ',' as thousands separator.
404
405       ignore dot (on, off*)
406               Allows use of '.' as thousands separator.
407
408       imaginary j, imgj (on, off*)
409               Use  'j'  (instead  of 'i') as default symbol for the imaginary
410               unit.
411
412       input base, inbase (-1114112 - 1114112, bin, oct, dec*, hex, roman)
413
414       limit implicit multiplication, limimpl (on, off*)
415
416       parsing mode, syntax (0* = adaptive, 1 = implicit first,  2  =  conven‐
417       tional, 3 = chain, 4 = rpn)
418               See syntax section.
419
420       read precision, readprec (0* = off, 1 = always, 2 = when decimals)
421               If activated, numbers be interpreted as approximate with preci‐
422               sion  equal  to  the  number  of  significant  digits  (3.20  =
423               3.20+/-0.005).
424
425       Units:
426
427       all prefixes, allpref (on, off*)
428               Enables automatic use of hecto, deca, deci, and centi.
429
430       autoconversion, conv (none, optimal*, base, optimalsi, mixed)
431               Controls  automatic  unit conversion of the result. 'optimalsi'
432               always converts non-SI units, while 'optimal' only converts  to
433               more optimal unit expressions, with less units and exponents.
434
435       binary prefixes, binpref (on, off*)
436               If  activated, binary prefixes are used by default for informa‐
437               tion units.
438
439       currency conversion, curconv (on*, off)
440               Enables automatic conversion to the local currency when optimal
441               unit conversion is enabled.
442
443       denominator prefixes, denpref (on*, off)
444               Enables  automatic  use  of prefixes in the denominator of unit
445               expressions.
446
447       place units separately, unitsep (on*, off)
448               If activated, units are separated from variables at the end  of
449               the result.
450
451       prefixes, pref (on*, off)
452               Enables automatic use of prefixes in the result.
453
454       show negative exponents, negexp (on, off*)
455               Use  negative exponents instead of division for units in result
456               (m/s = m*s^-1).
457
458       sync units, sync (on*, off)
459
460       temperature units, temp (hybrid*, absolute, relative)
461               Determines how expressions with temperature  units  are  calcu‐
462               lated  (hybrid acts as absolute if the expression contains dif‐
463               ferent temperature units, otherwise as relative).
464
465       update exchange rates, upxrates (-1 = ask*, 0 = never, > 0 = days)
466
467       Other:
468
469       ignore locale (yes, no*)
470               Ignore system language and use English (requires restart).
471
472       rpn (on, off*)
473               Activates the Reverse Polish Notation stack.
474
475       save definitions (yes*, no)
476               Save functions, units, and variables on exit.
477
478       save mode (yes*, no)
479               Save settings on exit.
480

SYNTAX

482       Mathematical entities:
483
484              Numbers
485              These are the regular numbers composed by digits 0-9 and a deci‐
486              mal  sign — a dot, or a comma if it is the default decimal point
487              in the locale/language used. If comma is used as  decimal  sign,
488              the  dot  is  still  kept as an alternative decimal sign, if not
489              explicitely deactivated. Numbers include integers, real numbers,
490              and  complex  numbers. The imaginary part of complex numbers are
491              written with as regular number followed by the special  variable
492              "i"  (can be changed to a "j"), which represents the square root
493              of -1. Spaces between digits are ignored ("5  5 = 55"). "E"  (or
494              "e") can be considered as a shortcut for writing many zeroes and
495              is equivalent to multiplication by 10 raised to the power of the
496              right-hand  value  (e.g. "5E3 = 5000"). Sexagesimal numbers (and
497              time) can be entered directly using colons (e.g. "5:30 =  5.5").
498              A  number  immediately  preceeded  "0b",  "0o", "0d" or "0x" are
499              interpreted as a number with base 2, 8, 12 or  16,  respectively
500              (e.g. "0x3f = 63").
501
502              Intervals
503              A  number interval can be entered using the interval() function,
504              the uncertainty() function, or using "±" or "+/-"  (e.g.  5±1  =
505              uncertainty(5,  0.2)  =  interval(4,  6)). If the read precision
506              option is activated,  decimal  numbers  are  interpreted  as  an
507              interval  between  the  numbers that are normally rounded to the
508              entered number (e.g. 1.1 = 1.1±0.05).  If  interval  calculation
509              using variance formula is activated (default), the interval rep‐
510              resents the standard uncertainty (deviation) of the value.
511
512              Vectors and Matrices
513              A matrix is a two-dimensional rectangular array of  mathematical
514              objects.  Vectors  are matrices with only one row or column, and
515              thus one-dimensional sequences of objects. Vectors and  matrices
516              are  generated by various functions, or using syntax in the form
517              of [1, 2, 3, 4] and [[1, 2], [3, 4]].
518
519              Variables/Constants
520              See the list of variables in the GUI manual or using the command
521              .I list variables
522
523              Functions
524              See the list of functions in the GUI manual or using the command
525              .I list functions
526
527              Units and Prefixes
528              See the list of units and prefixes in the GUI  manual  or  using
529              the  command  .I  list  units.  Abbreviated, plural and singular
530              forms of unit names and prefixes are generally allowed. Prefixes
531              must  be  put  immediately  before the unit to be interpreted as
532              prefixes (eg. 5 mm = 0.005 m, but 5 m m =  5  m^2).  For  conve‐
533              nience  units allow the power operator to be left out (e.g. 5 m2
534              = 5 m^2), with currencies excluded.
535
536              Unknowns
537              Unknowns are text strings without any  associated  value.  These
538              are   temporary  unknown  variables  with  default  assumptions.
539              Unknowns can also be explicitly entered by placing  a  backslash
540              (\)  before  a single character (e.g. 5\a + 2\b) or using quota‐
541              tion mark before and after a text string (e.g. 5  "apples"  +  2
542              "bananas").  If  unknowns  are  activated characters without any
543              associated variable, function or unit in an expression, will  be
544              regarded as an unknown variable.
545
546              Date and Time
547              Date/time  values are specified using quoted text string (quota‐
548              tion marks are not needed for function arguments),  using  stan‐
549              dard date and time format (YYYY-MM-DDTHH:MM:SS). Some local for‐
550              mats are also supported, but not  recommended.  The  local  time
551              zone are used, unless a time zone is specified at the end of the
552              time string (Z/UTC/GMT or +/-HH:MM). Date/time supports a  small
553              subset  of arithmetic operations. The time units represents cal‐
554              ender time, instead of average values, when added or  subtracted
555              to a date.
556
557              Text
558              This  category represent a number of different function argument
559              types, such as regular text and file names. They can, but do not
560              need  to  be  put  in quotes except when containing the argument
561              separator.
562
563              Comments
564              All text after a hashtag  (e.g.  (5*2)/2  #calculating  triangle
565              area) is treated as a comment, which are added to the history.
566
567       Operations and operators (word operators such as AND must be surrounded
568       by space):
569
570              Addition (+)
571
572              Subtraction (-)
573
574              Multiplication (*)
575
576              Division (/)
577
578              Modulo (%, mod)
579              Returns the remainder after division.
580
581              Integer Division (//, div)
582              Rounds the result of division towards zero.
583
584              Exponentiation (^, **)
585              Note that x^y^z equals x^(y^z), and not (x^y)^z. Note also  that
586              for  non-integer  exponents  with  negative bases, the principal
587              root is returned and not the real root ((-8)^(1/3)  equals  1  +
588              1.73i, and not -2). To calculate the real root for negative val‐
589              ues, use the cbrt() and root() functions.
590
591              10^x (E)
592
593              Parenthesis ((, ))
594
595              Logical operators (!, ||, OR, &&, AND)
596              Primarily used in conjunction with comparisons.
597
598              Bitwise operators (~, |, &, <<, >>, XOR)
599
600              Comparison operators (=, !=, <, <=, >, >=)
601              Returns 1 if expression is true and 0 if false. The  x  variable
602              is  isolated  if  the  expression  does  not evaluate as true or
603              false. Primarily used for equations and inequalities.
604
605       Evaluation priority order:  parenthesis,  10^x,  exponentiation,  func‐
606       tions,  bitwise NOT, logical NOT, multiplication/division/modulo, addi‐
607       tion/subtraction, bitwise NOT, bitwise shift, comparisons, bitwise AND,
608       bitwise XOR, bitwise OR, logical AND, logical OR.
609
610       The evaluation of short/implicit multiplication without any multiplica‐
611       tion sign (e.g. 5x, 5(2+3)), differs depending on the parsing mode.  In
612       the  conventional  mode  implicit  multiplication  does not differ from
613       explicit multiplication (12/2(1+2) = 12/2*3 = 18, 5x/5y = 5 * x/5 * y =
614       xy).  In  the parse implicit multiplication first mode, implicit multi‐
615       plication is parsed before explicit multiplication (12/2(1+2) = 12/(2 *
616       3) = 2, 5x/5y = (5 * x)/(5 * y) = x/y). The default adaptive mode works
617       as the parse implicit multiplication  first  mode,  unless  spaces  are
618       found  (1/5x  = 1/(5 * x), but 1/5 x = (1/5) * x). In the adaptive mode
619       unit expressions are parsed separately (5 m/5 m/s = (5 * m)/(5 * (m/s))
620       =  1 s). Function arguments without parentheses are an exception, where
621       implicit multiplication in front of variables and units is parsed first
622       regardless of mode (sqrt 2x = sqrt(2x)).
623
624       In  chain mode, expressions are calculated from left to right, ignoring
625       standard order of operations, as the immediate execution mode of a tra‐
626       ditional calculator (1+2*3 = (1+2)*3 = 9).
627
628       The  "to"-operator  is used for unit conversion and manipulation of how
629       the result is presented. Place " to " or a right arrow (e.g. "->") fol‐
630       lowed  by  one  of  expressions/commands  the  below,  at the end of an
631       expression.
632
633       Unit conversion
634               - a unit or unit expression (e.g. meter or km/h)
635               prepend with ? to request the optimal prefix
636               prepend with b? to request the optimal binary prefix
637               prepend with + or - to force/disable use of mixed units
638               - a variable or physical constant (e.g. c)
639               - base (convert to base units)
640               - optimal (convert to optimal unit)
641               - mixed (convert to mixed units, e.g. hours + minutes)
642
643       Number base conversion
644               - bin, binary (show as binary number)
645               - bin# (show as binary number with specified number of bits)
646               - oct, octal (show as octal number)
647               - duo, duodecimal (show as duodecimal number)
648               - hex, hexadecimal (show as hexadecimal number)
649               - hex# (show as hexadecimal number  with  specified  number  of
650               bits)
651               - sex, sexagesimal (show as sexagesimal number)
652               - bijective (shown in bijective base-26)
653               -  fp16, fp32, fp64, fp80, fp128 (show in binary floating-point
654               format)
655               - roman (show as roman numerals)
656               - time (show in time format)
657               - unicode
658               - base # (show in specified number base)
659               - bases (show as binary, octal, decimal and hexadecimal number)
660
661       Complex format
662               - rectangular, cartesian (show complex numbers  in  rectangular
663               form)
664               - exponential (show complex numbers in exponential form)
665               - polar (show complex numbers in polar form)
666               - cis (show complex numbers in cis form)
667               - angle, phasor (show complex numbers in angle/phasor notation)
668
669       Time and date conversion
670               - UTC (show date and time in UTC time zone)
671               - UTC+/-hh[:mm] (show date and time in specified time zone)
672               - calendars
673
674       Other conversion commands
675               - fraction (show result as mixed fraction)
676               - factors (factorize result)
677
678       Similarily  where  (or  alternatively "/.") can be used at the end (but
679       before "to"), for variable  assignments,  function  replacements,  etc.
680       (e.g.  "x+y  where  x=1  and y=2", "x^2=4 where x>0", and "sin(5) where
681       sin()=cos()").
682

EXAMPLES

684       Note that semicolon can be replaced with comma, if comma is not used as
685       decimal or thousands separator.
686
687       Basic functions and operators
688
689       sqrt 4  = sqrt(4)
690               = 4^(0.5)
691               = 4^(1/2)
692               = 2
693
694       sqrt(25; 16; 9; 4)
695               = [5; 4; 3; 2]
696
697       sqrt(32)
698               = 4 * sqrt(2) (in exact mode)
699
700       cbrt(-27)
701               = root(-27; 3)
702               = -3 (real root)
703
704       (-27)^(1/3)
705               = 1.5 + 2.5980762i (principal root)
706
707       ln 25   = log(25; e)
708               = 3.2188758
709
710       log2(4)/log10(100)
711               = log(4; 2)/log(100; 10)
712               = 1
713
714       5!      = 1 * 2 * 3 * 4 * 5
715               = 120
716
717       5\2 (integer division)
718               = 5//2
719               = trunc(5/2)
720               = 2
721
722       5 mod 3 = mod(5; 3)
723               = 2
724
725       52 to factors
726               = 2^2 * 13
727
728       25/4 * 3/5 to fraction
729               = 3 + 3/4
730
731       gcd(63; 27)
732               = 9
733
734       sin(pi/2) - cos(pi)
735               = sin(90 deg) - cos(180 deg)
736               = 2
737
738       sum(x; 1; 5)
739               = 1 + 2 + 3 + 4 + 5 = 15
740
741       sum(i^2+sin(i); 1; 5; i)
742               = 1^2 + sin(1) + 2^2 + sin(2) + ... = 55.176162
743
744       product(x; 1; 5)
745               = 1 * 2 * 3 * 4 * 5 = 120
746
747       var1:=5 store value 5 in variable var1
748
749       5^2 #this is a comment
750               = 25
751
752       sinh(0.5) where sinh()=cosh()
753               = cosh(0.5) = 1.1276260
754
755       plot(x^2; -5; 5)
756               plots the function y=x^2 from -5 to 5
757
758       Units
759
760       5 dm3 to L
761               = 25 dm^3 to L
762               = 5 L
763
764       20 miles / 2h to km/h
765               = 16.09344 km/h
766
767       1.74 to ft = 1.74 m to ft
768               = 5 ft + 8.5039370 in
769
770       1.74 m to -ft
771               = 5.7086614 ft
772
773       100 lbf * 60 mph to hp
774               = 16 hp
775
776       50 Ω * 2 A
777               = 100 V
778
779       50 Ω * 2 A to base
780               = 100 kg*m^2*s^-3*A^-1
781
782       10 N / 5 Pa
783               = (10 N)/(5 Pa) = 2 m^2
784
785       5 m/s to s/m
786               = 0.2 s/m
787
788       500 EUR - 20% to USD
789               = 451.04 USD
790
791       500 megabit/s * 2 h to b?byte
792               = 419.09516 gibibytes
793
794       Physical constants
795
796       k_e / G * a_0
797               = (coulombs_constant / newtonian_constant) * bohr_radius
798               = 7.126e9 kg*H*m^-1
799
800       planck ∕ (compton_wavelength * c)
801               = 9.1093837e-31 kg
802
803       5 ns * rydberg to c
804               = 6.0793194E-8c
805
806       atom(Hg; weight) + atom(C; weight) * 4 to g
807               = 4.129e-22 g
808
809       (G * planet(earth; mass) * planet(mars; mass))/(54.6e6 km)^2
810               = 8.58e16 N (gravitational attraction between earth and mars)
811
812       Uncertainty and interval arithmetic
813       result with interval arithmetic activated is shown in parenthesis
814
815       sin(5+/-0.2)^2/2+/-0.3
816               = 0.460±0.088 (0.46+/-0.12)
817
818       (2+/-0.02 J)/(523+/-5 W)
819               = 3.824+/-0.053 ms (3.82+/-±0.075 ms)
820
821       interval(-2; 5)^2
822               = intervall(-8.2500000; 12.750000) (intervall(0; 25))
823
824       Algebra
825
826       (5x^2 + 2)/(x - 3)
827               = 5x + 15 + 47/(x - 3)
828
829       (\a + \b)(\a - \b) = ("a" + "b")("a" - "b")
830               = 'a'^2 - 'b'^2
831
832       (x + 2)(x - 3)^3
833               = x^4 - 7x^3 + 9x^2 + 27x - 54
834
835       factorize x^4 - 7x^3 + 9x^2 + 27x - 54
836               = x^4 - 7x^3 + 9x^2 + 27x - 54 to factors
837               = (x + 2)(x - 3)^3
838
839       cos(x)+3y^2 where x=pi and y=2
840               = 11
841
842       gcd(25x; 5x^2)
843               = 5x
844
845       1/(x^2+2x-3) to partial fraction
846               = 1/(4x - 4) - 1/(4x + 12)
847
848       x+x^2+4 = 16
849               x = 3 or x = -4
850
851       x^2/(5 m) - hypot(x; 4 m) = 2 m where x>0
852               x = 7.1340411 m
853
854       cylinder(20cm; x) = 20L
855               x = (1 / (2pi)) m
856               x = 16 cm (height of 20 L cylinder with radius 20 cm)
857
858       asin(sqrt(x)) = 0.2
859               x = sin(0.2)^2
860               x = 0.039469503
861
862       x^2 > 25x
863               = x > 25 or x < 0
864
865       solve(x = y+ln(y); y)
866               = lambertw(e^x)
867
868       solve2(5x=2y^2; sqrt(y)=2; x; y)
869               = 32/5
870
871       multisolve([5x=2y+32; y=2z; z=2x]; [x; y; z])
872               = [-32/3; -128/3; -64/3]
873
874       dsolve(diff(y; x) - 2y = 4x; 5)
875               = 6e^(2x) - 2x - 1
876
877       Calculus
878
879       diff(6x^2)
880               = 12x
881
882       diff(sinh(x^2)/(5x) + 3xy/sqrt(x))
883               = (2/5) * cosh(x^2) - sinh(x^2)/(5x^2) + (3y)/(2 * sqrt(x))
884
885       integrate(6x^2)
886               = 2x^3 + C
887
888       integrate(6x^2; 1; 5)
889               = 248
890
891       integrate(sinh(x^2)/(5x) + 3xy/sqrt(x))
892               = 2x * sqrt(x) * y + Shi(x^2) / 10 + C
893
894       integrate(sinh(x^2)/(5x) + 3xy/sqrt(x); 1; 2)
895               = 3.6568542y + 0.87600760
896
897       limit(ln(1 + 4x)/(3^x - 1); 0)
898               = 4 / ln(3)
899
900       Matrices and vectors
901
902       ((1; 2; 3); (4; 5; 6))
903               = [[1; 2; 3]; [4; 5; 6]] (2x3 matrix)
904
905       (1; 2; 3) * 2 - 2
906               = [1 * 2 - 2; 2 * 2 - 2; 3 * 2 - 2]
907               = [0; 2; 4]
908
909       (1; 2; 3) * (4; 5; 6)
910               = 32 (dot product)
911
912       cross((1; 2; 3); (4; 5; 6))
913               = [-3; 6; -3] (cross product)
914
915       ((1; 2; 3); (4; 5; 6)) * ((7; 8); (9; 10); (11; 12))
916               = [[58; 64]; [139; 154]]
917
918       hadamard([[1; 2; 3]; [4; 5; 6]]; [[7; 8; 9]; [10; 11; 12]])
919               = [[7; 16; 27]; [40; 55; 72]] (hadamard product)
920
921       ((1; 2); (3; 4))^-1
922               = inverse([[1; 2]; [3; 4]])
923               = [[-2; 1]; [1.5; -0.5]]
924
925       Statistics
926
927       mean(5; 6; 4; 2; 3; 7)
928               = 4.5
929
930       stdev(5; 6; 4; 2; 3; 7)
931               = 1.87
932
933       quartile((5; 6; 4; 2; 3; 7); 1)
934               = percentile([5; 6; 4; 2; 3; 7]; 25)
935               = 2.9166667
936
937       normdist(7; 5)
938               = 0.053990967
939
940       spearman(column(load(test.csv); 1); column(load(test.csv); 2))
941               = -0.33737388 (depends on the data in the CSV file)
942
943       Time and date
944
945       10:31 + 8:30 to time
946               = 19:01
947
948       10h 31min + 8h 30min to time
949               = 19:01
950
951       now to utc
952               = "2020-07-10T07:50:40Z"
953
954       "2020-07-10T07:50CET" to utc+8
955               = "2020-07-10T14:50:00+08:00"
956
957       "2020-05-20" + 523d
958               = addDays(2020-05-20; 523)
959               = "2021-10-25"
960
961       today - 5 days
962               = "2020-07-05"
963
964       "2020-10-05" - today
965               = days(today; 2020-10-05)
966               = 87
967
968       timestamp(2020-05-20)
969               = 1 589 925 600
970
971       stamptodate(1 589 925 600)
972               = "2020-05-20T00:00:00"
973
974       "2020-05-20" to calendars
975               returns  date  in  Hebrew,  Islamic,  Persian, Indian, Chinese,
976               Julian, Coptic, and Ethiopian calendars
977
978       Number bases
979
980       52 to bin
981               = 0011 0100
982
983       52 to bin16
984               = 0000 0000 0011 0100
985
986       52 to oct
987               = 064
988
989       52 to hex
990               = 0x34
991
992       0x34    = hex(34)
993               = base(34; 16)
994               = 52
995
996       523<<2&250 to bin
997               = 0010 1000
998
999       52.345 to float
1000               = 0100 0010 0101 0001 0110 0001 0100 1000
1001
1002       float(01000010010100010110000101001000)
1003               = 1715241/32768
1004               = 52.345001
1005
1006       floatError(52.345)
1007               = 1.2207031e-6
1008
1009       52.34 to sexa
1010               = 52°20'24"
1011
1012       1978 to roman
1013               = MCMLXXVIII
1014
1015       52 to base 32
1016               = 1K
1017
1018       sqrt(32) to base sqrt(2)
1019               = 100000
1020

SEE ALSO

1022       The  manual  of  the  graphical  user   interface   at   https://qalcu
1023       late.github.io/manual/index.html  (includes more details about the syn‐
1024       tax and elements supported in  mathematical  expressions,  and  various
1025       options,  and  includes  a  complete  list of functions, variables, and
1026       units)
1027

BUGS

1029       Please  report  any  bugs   at   https://github.com/Qalculate/libqalcu
1030       late/issues
1031

AUTHORS

1033       Hanna Knutsson <hanna.knutsson@protonmail.com>.
1034
1035
1036
1037                                 13 July 2020                          QALC(1)
Impressum