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. In‐
195               dex 1 is the top of stack and negative index values counts 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 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 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               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 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 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 ex‐
489              plicitely 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 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              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 ex‐
613       plicit 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 ex‐
631       pression.
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,  sexa2, sexa3, sexagesimal (show as sexagesimal number;
652               sexa2 hides and sexa3 rounds arcseconds)
653               - latitude, latitude2, longitude, longitude2 (show as sexagesi‐
654               mal  latitude/longitude;  latitude2 and longitude2 hide arcsec‐
655               onds)
656               - bijective (shown in bijective base-26)
657               - fp16, fp32, fp64, fp80, fp128 (show in binary  floating-point
658               format)
659               - roman (show as roman numerals)
660               - time (show in time format)
661               - unicode
662               - base # (show in specified number base)
663               - bases (show as binary, octal, decimal and hexadecimal number)
664
665       Complex format
666               -  rectangular,  cartesian (show complex numbers in rectangular
667               form)
668               - exponential (show complex numbers in exponential form)
669               - polar (show complex numbers in polar form)
670               - cis (show complex numbers in cis form)
671               - angle, phasor (show complex numbers in angle/phasor notation)
672
673       Time and date conversion
674               - UTC (show date and time in UTC time zone)
675               - UTC+/-hh[:mm] (show date and time in specified time zone)
676               - calendars
677
678       Other conversion commands
679               - fraction (show result as mixed fraction)
680               - factors (factorize result)
681
682       Similarily where (or alternatively "/.") can be used at  the  end  (but
683       before  "to"),  for  variable  assignments, function replacements, etc.
684       (e.g. "x+y where x=1 and y=2", "x^2=4 where  x>0",  and  "sin(5)  where
685       sin()=cos()").
686

EXAMPLES

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

SEE ALSO

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

BUGS

1032       Please report any bugs at https://github.com/Qalculate/libqalculate/is
1033       sues
1034

AUTHORS

1036       Hanna Knutsson <hanna.knutsson@protonmail.com>.
1037
1038
1039
1040                                 13 July 2020                          QALC(1)
Impressum