Credits Overview Plotting Styles Commands Terminals

Constants

Integer constants are interpreted via the C library routine strtoll(). This means that constants beginning with "0" are interpreted as octal, and constants beginning with "0x" or "0X" are interpreted as hexadecimal.

Floating point constants are interpreted via the C library routine atof().

Complex constants are expressed as {<real>,<imag>}, where <real> and <imag> must be numerical constants. For example, {0,1} represents 'i' itself; {3,2} represents 3 + 2i. The curly braces are explicitly required here. The program predefines a variable I = {0,1} on entry that can be used to avoid typing the explicit form. For example 3 + 2*I is the same as {3,2}, with the advantage that it can be used with variable coefficient for the imaginary component. Thus x + y*I is a valid expression but {x,y} is not.

String constants consist of any sequence of characters enclosed either in single quotes or double quotes. The distinction between single and double quotes is important. See quotes.

Examples:

     1 -10 0xffaabb        # integer constants
     1.0 -10. 1e1 3.5e-1   # floating point constants
     {1.2, -3.4}           # complex constant
     "Line 1\nLine 2"      # string constant (\n is expanded to newline)
     '123\na\456'          # string constant (\ and n are ordinary characters)