expr - evaluate a mathematical expression. 
  Outputs a result.

Taken from the man page with expanded descriptions.

For the following comparisons,
  Conditional matches output a 1 and return a 0 (success) status.
  Failed matches output a 0 and return a 1 (fail) status.
 
  # backslash required for any use of < or > in the following.

  Accepts signed integers. e.g -7 +7

  If all characters in strings numeric,
    Evaluated numerically, zero padding OK. e.g  07 is equal to 7
  
  Strings evaluated using collating ASCII. e.g bob is greater than bill
     1a is greater than 02



The following mathematical forms generate the result if input values valid.
  Input : signed integers.
  Results : signed integer.



The following do various string processing..
  STRING may be constant or variable reference.

  STRING : REGEXP
    anchored pattern match of REGEXP in STRING
    Uses regular expression to match STRING.
      Regular expression controls whether match exact or close.
    Returns count of matched characters.

    var=house
    expr "$var" : "\<hous\>"

    0

    expr "$var" : "hous"

    4

    expr "$var" : "[a-z]*"

    5

  match STRING REGEXP
    same as STRING : REGEXP 
    alternative to the :

    expr match "$var" "[a-z]*"

    5

  substr STRING POS LENGTH
    substring of STRING, POS counted from 1

    Outputs the substring of the larger STRING 
      starting at character POS, POS <= length of string value. 
      for LENGTH number of characters. LENGTH > 0

    var=house
    expr substr "$var" 2 3

    ous

  index STRING CHARS
    index in STRING where any CHARS is found, or 0
    CHARS is list of possible characters to match, order unimportant.
    Outputs index of 1st matched character
    STRING indexed from 1.

    var=house
    expr index "$var" uo
    2

  length STRING
    outputs length of STRING

  #+ TOKEN
  #  interpret TOKEN as a string, even if it is a
  #  keyword like 'match' or an operator like '/'



bc - interactive infix calculator. dc - interactive post-fix or rpn calculator. However, it will also take input from a file or piping. echo 4 k 87 23 / p | dc 3.7826