$ dc
2 2.5 ^ p
Runtime warning: non-zero scale in exponent
4

When trying to calculate BASE ^ EXPONENT using dc, it gives an error, then outputs the result as if the exponent were integral, so in the example above it outputs 4 which is 2^2.

One way to get around this is to use the built-in natural logarithm functions of bc (not dc) as below.

N.B. The function “l()” below has a lowercase L at the front, not a 1 (one).

$ bc -l
e(l(2)*2.5) <-- i.e. This calculates 2 ^ 2.5.
5.65685424949238019507
e(l(2)*0.5) <-- i.e. This calculates 2 ^ 0.5, i.e. √2.
1.41421356237309504878
e(l(2)*-0.5) <-- i.e. This calculates 2 ^ -0.5, i.e. 1 / √2.
.70710678118654752440

Pros: Works even if BASE is nonintegral. Works even if EXPONENT is negative.