Sample Header Ad - 728x90

Fractional exponents in dc

0 votes
1 answer
100 views
Is there a way to use exponents with fractional components in dc? Example:
user@box:~$ dc
9k

2 2 ^ p
4

2 2.5 ^ p
Runtime warning: non-zero scale in exponent
4
The man page states:
Arithmetic
...
       ^      Pops two values and exponentiates, using the first value  popped
              as the exponent and the second popped as the base.  The fraction
              part of the exponent is ignored.  The precision value  specifies
              the number of fraction digits in the result.
*The fraction part of the exponent is ignored.* It seems plain, but is there a simple way around this?
Asked by WhiteHotLoveTiger (590 rep)
Apr 29, 2024, 01:09 PM
Last activity: Apr 29, 2024, 06:33 PM