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 highlight 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, boolean).
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 variable 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. In‐
195               dex 1 is the top of stack and negative index values count  from
196               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 count 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               count 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 count 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, asm (unknown*, non-zero, positive, negative, non-positive,
256       non-negative + number, real*, rational, integer, boolean)
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 ex‐
267               act 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               Interpret 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 to‐
380               wards 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 is 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 are interpreted as approximate with pre‐
422               cision 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 ex‐
489              plicitly 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 preceded "0b", "0o", "0d" or "0x" are in‐
499              terpreted 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 op‐
506              tion is activated, decimal numbers are interpreted as an  inter‐
507              val between the numbers that are normally rounded to the entered
508              number (e.g. 1.1 =  1.1±0.05).  If  interval  calculation  using
509              variance formula is activated (default), the interval represents
510              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. Un‐
539              knowns can also be explicitly entered by placing a backslash (\)
540              before  a  single  character (e.g. 5\a + 2\b) or using quotation
541              mark before and after a text string (e.g. 5 "apples"  +  2  "ba‐
542              nanas").  If unknowns are activated characters without any asso‐
543              ciated variable, function or unit in an expression, will be  re‐
544              garded 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              endar 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              Remainder (%, rem) and 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 (!, NOT, ||, OR, &&, AND, XOR, NOR, NAND)
596
597              Bitwise operators (~, |, &, <<, >>, XOR)
598
599              Comparison operators (=, !=, <, <=, >, >=)
600              Returns 1 if expression is true and 0 if false. The  x  variable
601              is  isolated  if  the  expression  does  not evaluate as true or
602              false. Primarily used for equations and inequalities.
603
604              Dot product (.)
605
606              Element-wise operators (.*, ./, .^)
607
608              Save operator (:=)
609              Saves the expression to the right of the operator as a  variable
610              or function (e.g. var1:=5, func1():=x+y).
611
612       Evaluation  priority  order:  parenthesis,  10^x, exponentiation, func‐
613       tions, bitwise NOT, logical NOT, multiplication/division/remainder, ad‐
614       dition/subtraction,  bitwise  NOT,  bitwise shift, comparisons, bitwise
615       AND, bitwise XOR, bitwise OR, logical AND, logical OR.
616
617       The evaluation of short/implicit multiplication without any multiplica‐
618       tion  sign (e.g. 5x, 5(2+3)), differs depending on the parsing mode. In
619       the conventional mode implicit multiplication does not differ from  ex‐
620       plicit  multiplication  (12/2(1+2) = 12/2*3 = 18, 5x/5y = 5 * x/5 * y =
621       xy). In the parse implicit multiplication first mode,  implicit  multi‐
622       plication is parsed before explicit multiplication (12/2(1+2) = 12/(2 *
623       3) = 2, 5x/5y = (5 * x)/(5 * y) = x/y). The default adaptive mode works
624       as  the  parse  implicit  multiplication  first mode, unless spaces are
625       found (1/5x = 1/(5 * x), but 1/5 x = (1/5) * x). In the  adaptive  mode
626       unit expressions are parsed separately (5 m/5 m/s = (5 * m)/(5 * (m/s))
627       = 1 s). Function arguments without parentheses are an exception,  where
628       implicit multiplication in front of variables and units is parsed first
629       regardless of mode (sqrt 2x = sqrt(2x)).
630
631       In chain mode, expressions are calculated from left to right,  ignoring
632       standard  order  of  operations, like the immediate execution mode of a
633       traditional calculator (1+2*3 = (1+2)*3 = 9).
634
635       The "to"-operator is used for unit conversion and manipulation  of  how
636       the result is presented. Place " to " or a right arrow (e.g. "->") fol‐
637       lowed by one of expressions/commands the below, at the end  of  an  ex‐
638       pression.
639
640       Unit conversion
641               - a unit or unit expression (e.g. meter or km/h)
642               prepend with ? to request the optimal prefix
643               prepend with b? to request the optimal binary prefix
644               prepend with + or - to force/disable use of mixed units
645               - a variable or physical constant (e.g. c)
646               - base (convert to base units)
647               - optimal (convert to optimal unit)
648               - mixed (convert to mixed units, e.g. hours + minutes)
649
650       Number base conversion
651               - bin, binary (show as binary number)
652               - bin# (show as binary number with specified number of bits)
653               - oct, octal (show as octal number)
654               - duo, duodecimal (show as duodecimal number)
655               - hex, hexadecimal (show as hexadecimal number)
656               -  hex#  (show  as  hexadecimal number with specified number of
657               bits)
658               - sex, sexa2, sexa3, sexagesimal (show as  sexagesimal  number;
659               sexa2 hides and sexa3 rounds arcseconds)
660               - latitude, latitude2, longitude, longitude2 (show as sexagesi‐
661               mal latitude/longitude; latitude2 and longitude2  hide  arcsec‐
662               onds)
663               - bijective (shown in bijective base-26)
664               -  fp16, fp32, fp64, fp80, fp128 (show in binary floating-point
665               format)
666               - roman (show as roman numerals)
667               - time (show in time format)
668               - unicode
669               - base # (show in specified number base)
670               - bases (show as binary, octal, decimal and hexadecimal number)
671
672       Complex format
673               - rectangular, cartesian (show complex numbers  in  rectangular
674               form)
675               - exponential (show complex numbers in exponential form)
676               - polar (show complex numbers in polar form)
677               - cis (show complex numbers in cis form)
678               - angle, phasor (show complex numbers in angle/phasor notation)
679
680       Time and date conversion
681               - UTC (show date and time in UTC time zone)
682               - UTC+/-hh[:mm] (show date and time in specified time zone)
683               - calendars
684
685       Other conversion commands
686               - fraction (show result as mixed fraction)
687               - factors (factorize result)
688
689       Similarly where (or alternatively "/.") can be used at the end (but be‐
690       fore "to"), for variable assignments, function replacements, etc. (e.g.
691       "x+y  where  x=1  and  y=2",  "x^2=4  where  x>0",  and  "sin(5)  where
692       sin()=cos()").
693

EXAMPLES

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

SEE ALSO

1034       The  manual  of  the  graphical  user   interface   at   https://qalcu
1035       late.github.io/manual/index.html  (includes more details about the syn‐
1036       tax and elements supported in mathematical expressions, and various op‐
1037       tions, and includes a complete list of functions, variables, and units)
1038

BUGS

1040       Please report any bugs at https://github.com/Qalculate/libqalculate/is
1041       sues
1042

AUTHORS

1044       Hanna Knutsson <hanna.knutsson@protonmail.com>.
1045
1046
1047
1048                                 13 July 2020                          QALC(1)
Impressum