# The Power Of

**URL:** https://forum.highend3d.com/t/the-power-of/2004
**Category:** Maya
**Tags:** mel
**Created:** [September 5, 2007, 11:54am UTC](https://forum.highend3d.com/t/the-power-of/2004 "2007-09-05T11:54:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![joel667](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/ee7513/32.png) [@joel667](https://forum.highend3d.com/u/joel667)
#### Post date: [September 5, 2007, 11:54am UTC](https://forum.highend3d.com/t/the-power-of/2004/1 "2007-09-05T11:54:26Z")

</div>

Hey, I hope I'm posting this in the correct section.

I've got a little problem that I want to solve using an expression. Without going into details about what I've done, I basicly have to write an expression using 'the power of' operator.  
I read through the documentation in the maya help files, and i can run the example it gives 'pow 2 4' which = 16, but when i try to assign that to an attribute using the expression editor, it just gives me a syntax error. What im trying to do is:

Object.Attribute = (1.7 \* ( pow PathLength.input1X -.73));  
PathLength.input1X is a float

I cant see any syntax errors in that, but even having the line  
Object.Attribute = pow 2 4; gives me a syntax error, which is copied straight from the documentation.

Is the syntax used in the expression editor different to that used in the script editor? and if so, how do I put a number to the power of another number? (i tried using the ^ and no dice)

Any help on this would be appreciated,  
Thanks, Joel

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [September 5, 2007, 12:06pm UTC](https://forum.highend3d.com/t/the-power-of/2004/2 "2007-09-05T12:06:19Z")

</div>

No but compuattional preceedence is.

pow 2 4 is shorthand, tat should be avoided, works fine standalone but does no group right.

pow(2,4) does as would probably `pow 2 4`

See the parser has no way of knowing wther:

PathLength.input1X -.73

means PathLength.input1X-.73 or if -.73 is the exponent

Object.Attribute = 1.7 \* pow(PathLength.input1X,-.73);

---

<div class="post-metadata">

### Author: ![joel667](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/ee7513/32.png) [@joel667](https://forum.highend3d.com/u/joel667)
#### Post date: [September 5, 2007, 1:41pm UTC](https://forum.highend3d.com/t/the-power-of/2004/3 "2007-09-05T13:41:50Z")

</div>

Thanks for your reply, I didn't realise what I was asking it to do until you spelt it out for me. I got it working, thats for the help ![]()
