How math function powr() from the frameworks RenderScript works?

29 views Asked by At

powr(2.0, 2.0) = 4.0 powr(-2.0, 2.0) = ? Please tell me. The documentation is not quite clear. Thanks

1

There are 1 answers

1
Stephen Hines On

The docs say that the first parameter (base) needs to be between 0.f and 256.f. You can't use it with a negative input.

P.S. RenderScript has been deprecated - https://developer.android.com/guide/topics/renderscript/migrate. You may want to consider this before writing further code using it.