There are a few more special expressions that are provided in
bc. These have to do with user-defined functions and standard
functions. They all appear as
)". See section Functions, for
user-defined functions. The standard functions are:
length ( expression )
read ( )
readfunction (an extension) will read a number from the standard input, regardless of where the function occurs. Beware, this can cause problems with the mixing of data and program in the standard input. The best use for this function is in a previously written program that needs input from the user, but never allows program code to be input from the user. The value of the
readfunction is the number read from the standard input using the current value of the variable ibase for the conversion base.
scale ( expression )
scalefunction is the number of digits after the decimal point in the expression.
sqrt ( expression )
sqrtfunction is the square root of the expression. If the expression is negative, a run time error is generated.
Go to the first, previous, next, last section, table of contents.