Friday, September 2, 2011

Re: [android-developers] Bug in Renderscript API of the pown()???

A reply to myself.

When the second parameter of pown() is negative integers, returns are
the NaN as follows.
How does the pown() work???

//code snippet
float4 f4 = {2.0f, 6.0f, 2.0f, 2.0f};
int4 i4 = {-1,1,-5,1};
float4 r4 = pown(f4,i4);
rsDebug("r4 = ", r4.x, r4.y, r4.z, r4.w);

//rsDebug log
09-03 10:34:06.650: DEBUG/RenderScript(2369): r4 = {NaN, 1.000000,
NaN, 1.000000}


Thanks.

2011/9/2 Macotonalds <macotonalds@gmail.com>:
>
> Hi, the function pown() in Renderscript may have bugs.
>
> //rs_cl.rsh
> _RS_RUNTIME float __attribute__((overloadable)) pown(float v, int p);
> _RS_RUNTIME float2 __attribute__((overloadable)) pown(float2 v, int2
> p);
> _RS_RUNTIME float3 __attribute__((overloadable)) pown(float3 v, int3
> p);
> _RS_RUNTIME float4 __attribute__((overloadable)) pown(float4 v, int4
> p);
>
> I experimentally execute the scalar version, float pown(float f,int
> i).
> Then it returns the value of f^i, so I think that it seems like the
> pow() function.
> Next I execute the vector version of pown(), but it seems that they
> don't work,
> because they always return the value 1.000000 as follows, this is
> float3 pown().
>
>        //code
>        float3 f3 = {2.0f, 3.0f, 10.0f};
>        int3 p3 = {10,5,2};
>        float3 r3 = pown(f3,p3);
>        rsDebug("pown : ", r3.x, r3.y, r3.z);
>
>        //rsDebug log of the above code
>        09-02 16:42:37.460: DEBUG/RenderScript(10395): pown :  {1.000000,
> 1.000000, 1.000000}
>
>
> Does anyone know about it?
> I'm hoping that someone can help me.
>
> Kind Regards,
> Macotonalds.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment