Lines Matching full:dc
33 dc - arbitrary-precision decimal reverse-Polish notation calculator
37 **dc** [**-cChiPRvVx**] [**-\-version**] [**-\-help**] [**-\-digit-clamp**] [**-\-no-digit-clamp**]…
41 dc(1) is an arbitrary-precision calculator. It uses a stack (reverse Polish
45 If no files are given on the command-line, then dc(1) reads from **stdin** (see
46 the **STDIN** section). Otherwise, those files are processed, and dc(1) will
52 this dc(1) will always start with a **scale** of **10**.
56 The following are the options that dc(1) accepts.
113 expressions and files, dc(1) will exit, unless **-** (**stdin**) was given
117 or equivalent is given, dc(1) will give a fatal error and exit.
129 expressions and files, dc(1) will exit, unless **-** (**stdin**) was given
132 **-f-** or equivalent is given, dc(1) will give a fatal error and exit.
176 want a prompt or are not used to having them in dc(1). Most of those users
188 do not want a read prompt or are not used to having them in dc(1). Most of
191 lines of dc(1) scripts that prompt for user input.
224 : Makes dc(1) print all numbers greater than **-1** and less than **1**, and
234 by the **-f**, **-\-file**, **-e**, or **-\-expression** options, then dc(1)
241 brackets, all brackets must be balanced before dc(1) parses and executes.
249 **Note**: Unlike other dc(1) implementations, this dc(1) will issue a fatal
251 **stdout** is closed, as in **dc <file> >&-**, it will quit with an error. This
252 is done so that dc(1) can report problems when **stdout** is redirected to a
255 If there are scripts that depend on the behavior of other dc(1) implementations,
263 **Note**: Unlike other dc(1) implementations, this dc(1) will issue a fatal
265 **stderr** is closed, as in **dc <file> 2>&-**, it will quit with an error. This
266 is done so that dc(1) can exit with an error code when **stderr** is redirected
269 If there are scripts that depend on the behavior of other dc(1) implementations,
283 The max allowable value for **ibase** can be queried in dc(1) programs with the
301 allowable value for **scale** can be queried in dc(1) programs with the **V**
322 means that the pseudo-random values from dc(1) should only be used where a
373 In addition, dc(1) accepts numbers in scientific notation. These have the form
381 if **ibase** is **16** and dc(1) is given the number string **FFeA**, the
382 resulting decimal number will be **2550000000000**, and if dc(1) is given the
636 dc(1) has a built-in pseudo-random number generator. These commands query the
657 non-integer, an error is raised, and dc(1) resets (see the **RESET**
813 dc(1) can work with both numbers and strings, and registers (see the
814 **REGISTERS** section) can hold both strings and numbers. dc(1) always knows
872 If either or both of the values are not numbers, dc(1) will raise an error
879 If either or both of the values are not numbers, dc(1) will raise an error
890 If either or both of the values are not numbers, dc(1) will raise an error
897 If either or both of the values are not numbers, dc(1) will raise an error
908 If either or both of the values are not numbers, dc(1) will raise an error
915 If either or both of the values are not numbers, dc(1) will raise an error
926 If either or both of the values are not numbers, dc(1) will raise an error
933 If either or both of the values are not numbers, dc(1) will raise an error
944 If either or both of the values are not numbers, dc(1) will raise an error
951 If either or both of the values are not numbers, dc(1) will raise an error
962 If either or both of the values are not numbers, dc(1) will raise an error
969 If either or both of the values are not numbers, dc(1) will raise an error
983 macro executing, dc(1) exits.
989 of levels to pop is greater than the number of executing macros, dc(1)
996 is exactly as many as is needed to make dc(1) exit with the **Q** command,
997 so the sequence **,Q** will make dc(1) exit.
1047 item) when dc(1) starts, dc(1) requires that each register's stack must
1048 always have at least one item; dc(1) will give an error and reset otherwise
1115 Unlike most other dc(1) implentations, this dc(1) provides nearly unlimited
1130 When dc(1) encounters an error or a signal that it has a non-default handler
1141 Thus, when dc(1) resets, it skips any remaining code waiting to be executed.
1148 Most dc(1) implementations use **char** types to calculate the value of **1**
1149 decimal digit at a time, but that can be slow. This dc(1) does something
1159 In addition, this dc(1) uses an even larger integer for overflow checking. This
1165 The following are the limits on dc(1):
1169 : The number of bits in the **long** type in the environment where dc(1) was
1215 : The maximum integer (inclusive) returned by the **'** command, if dc(1). Set
1234 As **non-portable extensions**, dc(1) recognizes the following environment
1239 : This is another way to give command-line arguments to dc(1). They should be
1245 functions that the user might want every time dc(1) runs. Another use would
1250 **"/home/gavin/some dc file.dc"** will be correctly parsed, but the string
1251 **"/home/gavin/some \"dc\" file.dc"** will include the backslashes.
1255 double quotes as the outside quotes, as in **"some 'dc' file.dc"**, and vice
1264 than **1** and is less than **UINT16_MAX** (**2\^16-1**), dc(1) will output
1273 : If dc(1) is not in interactive mode (see the **INTERACTIVE MODE** section),
1274 then this environment variable has no effect because dc(1) exits on
1277 However, when dc(1) is in interactive mode, then if this environment
1278 variable exists and contains an integer, a non-zero value makes dc(1) reset
1279 on **SIGINT**, rather than exit, and zero makes dc(1) exit. If this
1280 environment variable exists and is *not* an integer, then dc(1) will exit on
1292 exists and contains an integer, then a non-zero value makes dc(1) use TTY
1293 mode, and zero makes dc(1) not use TTY mode.
1304 exists and contains an integer, a non-zero value makes dc(1) use a prompt,
1305 and zero or a non-integer makes dc(1) not use a prompt. If this environment
1317 variable exists and contains an integer, a non-zero value makes dc(1) exit
1319 dc(1) not exit.
1327 integer, a non-zero value makes dc(1) clamp digits that are greater than or
1341 dc(1) returns the following exit statuses:
1387 files, attempting to use files that do not have only ASCII characters (dc(1)
1391 The exit status **4** is special; when a fatal error occurs, dc(1) always exits
1392 and returns **4**, no matter what mode dc(1) is in.
1394 The other statuses will only be returned when dc(1) is not in interactive mode
1395 (see the **INTERACTIVE MODE** section), since dc(1) resets its state (see the
1400 These exit statuses allow dc(1) to be used in shell scripting with error
1406 Like bc(1), dc(1) has an interactive mode and a non-interactive mode.
1411 In interactive mode, dc(1) attempts to recover from errors (see the **RESET**
1413 done for the current input. dc(1) may also reset on **SIGINT** instead of exit,
1420 mode" is considered to be available, and thus, dc(1) can turn on TTY mode,
1425 non-zero integer, dc(1) will turn on TTY mode when **stdin**, **stdout**, and
1427 variable exists but is *not* a non-zero integer, then dc(1) will not turn TTY
1465 Sending a **SIGINT** will cause dc(1) to do one of two things.
1467 If dc(1) is not in interactive mode (see the **INTERACTIVE MODE** section), or
1469 section), or its default, is either not an integer or it is zero, dc(1) will
1472 However, if dc(1) is in interactive mode, and the **DC_SIGINT_RESET** or its
1473 default is an integer and non-zero, then dc(1) will stop executing the current
1476 Note that "current input" can mean one of two things. If dc(1) is processing
1477 input from **stdin** in interactive mode, it will ask for more input. If dc(1)
1482 This means that if a **SIGINT** is sent to dc(1) as it is executing a file, it
1483 can seem as though dc(1) did not respond to the signal since it will immediately
1485 when interacting with dc(1) have function definitions, which are quick to parse.
1490 **SIGTERM** and **SIGQUIT** cause dc(1) to clean up and exit, and it uses the
1492 case, and only when dc(1) is in TTY mode (see the **TTY MODE** section), a
1493 **SIGHUP** will cause dc(1) to clean up and exit.
1497 dc(1) supports interactive command-line editing.
1499 If dc(1) can be in TTY mode (see the **TTY MODE** section), history can be
1510 This dc(1) ships with support for adding error messages for different locales
1519 The dc(1) utility operators and some behavior are compliant with the operators