Also known as Basic Calculator, UNIX bc
UNIX utility which implements an arbitrary-precision arithmetic language
(The letter ell.) Define the math functions and initialize scale to 20, instead of the default zero; see the EXTENDED DESCRIPTION section. Input files shall be text files containing a sequence of comments, statements, and function definitions that shall be executed as they are read. Provide a default value for the internationalization variables that are unset or null. (See XBD Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) If set to a non-empty string value, override the values of all the other internationalization variables. Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments and input files). Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. [XSI) ] ![[Option Start]]( Determine the location of message catalogs for the processing of LC MESSAGES. ![[Option End]]( The output of the bc utility shall be controlled by the program read, and consist of zero or more lines containing the value of all executed expressions without assignments. The radix and precision of the output shall be controlled by the values of the obase and scale variables; see the EXTENDED DESCRIPTION section. The grammar in this section and the lexical conventions in the following section shall together describe the syntax for bc programs. The general conventions for this style of grammar are described in Grammar Conventions . A valid program can be represented as the non-terminal symbol program in the grammar. This formal syntax shall take precedence over the text syntax description. 16. The following single characters shall be recognized as tokens whose names are the character: The following table summarizes the rules for precedence and associativity of all operators. Operators on the same line shall have the same precedence; rows are in order of decreasing precedence. Named expressions are places where values are stored. Named expressions shall be valid on the left side of an assignment. The value of a named expression shall be the value stored in the place named. Simple identifiers and array elements are named expressions; they have an initial value of zero and an initial scale of zero. If the absolute value of the numerical value is less than one but greater than zero and the scale of the numerical value is greater than zero, it is unspecified whether the character 0 is output. Very large numbers shall be split across lines with 70 characters per line in the POSIX locale; other locales may split at different character boundaries. Lines that are continued shall end with a . The unary increment and decrement operators shall not modify the scale of the named expression upon which they operate. The scale of the result shall be the scale of that named expression. The named expression shall be incremented by one. The result shall be the value of the named expression after incrementing. The named expression shall be decremented by one. The result shall be the value of the named expression after decrementing. The named expression shall be incremented by one. The result shall be the value of the named expression before incrementing. The named expression shall be decremented by one. The result shall be the value of the named expression before decrementing. When scale is zero, the '%' operator is the mathematical remainder operator. The result shall be the sum of the two expressions. The scale of the result shall be the maximum of the scales of the expressions. The result shall be the difference of the two expressions. The scale of the result shall be the maximum of the scales of the expressions. This expression shall result in assigning the value of the expression on the right to the named expression on the left. The scale of both the named expression and the result sha
Excerpt from a page describing this subject · 40,000 chars · not written by Vinony
via Wikidata · CC0
via Wikidata sitelinks · CC0
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).