Mathf.Pow return wrong value??

Hi guys,
I’m try use Mathf.Pow method but maybe I don’t know how it’s realy work…
Let’s go, it’s my debug code:

 Debug.Log ("Acceleration Y:  " + Input.acceleration.y + "  Result:  " + Mathf.Pow(Input.acceleration.y, 0) + "\nAccelerationX:  " + Input.acceleration.x + "  Result:  " + Mathf.Pow(Input.acceleration.x , 0));

Ok, it’s will get acceleration value and power of 0, right?
So, assuming than Y value is -0.875, -0.875 to the power of 0 is -1, but the unity return 1! why??
I’m forgetting something ??
Look this real output:

Acceleration Y:  -0.2080078  Result:  1
Acceleration X:  -0.08300781  Result:  1

Unity return 1 but it’s should be -1.
look this one:

Acceleration Y:  0.01171875  Result:  1
Acceleration X:  0.1259766  Result:  1

This one is right, it’s only work with positive number or I’m crazy? :confused:

Looks like you’re just overlooking math: anything to the zero power is 1, even negative numbers. :smile:

Are you sure?
Look:

Look carefully at the brackets in your screenshot.

Wow, I made a miss… :sweat_smile:
Seemingly I ignore it, for make this in Google and my smartphone calculator is need a brackets in negative sign, such as (-3) ^ 0, and in unity not.
Sory for it, I am very embarrassed. :sweat_smile:

As an alternative, maybe this is what you’re looking for.

Yes, is it! Thank you!