You have seen a few examples of expressions already, beyond simple location paths, Boolean expressions that test for truth or falsehood, and node set expressions that merge the results of several location paths into one. Now it is time to examine in detail the other kinds of expressions that XPath provides.
Numerical expressions work pretty much like they did in math at school. In XPath, you can write numbers as you might expect; all the following are legal XPath numerical expressions:
123 123.45 .5 0.5 -10.5
The mathematicians among you will notice that this means XPath deals in real numbers. They’re approximate floating-point numbers, too—the results of computations are not always exact, because all arithmetic is done ...