Is this the expected result?
| > 17->pow(0.5); | (41) Result: 1
If it is, can someone explain why? Also note that
| > 17->_sqrt(); | (38) Result: 4
works nicely. (I wanted a generic integer root, square, cube or nth.)
Looks like Gmp.mpz.pow converts its argument to an integer first, i.e. you actually do 17->pow(0). Gmp doesn't have any mpz pow function that takes a float power, so it's not trivial to make it work better.
I think it should be a separate function if it doesn't return an integer. It's rather the implicit float -> integer conversion that bothers me.
pike-devel@lists.lysator.liu.se