# Pow()

## Recommended Posts

Hi all,

Does anyone have a mathematics, Pow() function?

Thanks,

James

Edit:

This is right isn't it?

```Func Pow(\$x, \$y)
Return \$x ^ \$y
EndFunc```
Edited by JamesBrooks

##### Share on other sites

According to http://www.cafeaulait.org/course/week4/40.html it is... muttley

##### Share on other sites

Woo. I never needed this until now muttley

Shouldn't these basic math functions be added to the Math UDF? I mean, it's maths and so is the function. I am sure there are loads more like LambertW which should be added etc.

Edited by JamesBrooks

##### Share on other sites

Pow doesn't need to be added because the operator has been there for a LONG time.

##### Share on other sites

^, just realised.

##### Share on other sites

So you didn't read the help file from front to back like everyone else?

##### Share on other sites

For those of you who doesn't trust fancy mathematical operators like '*', '/' or '^' I've made 3 unsigned integer functions that only uses the '+' and '-' signs.

```MsgBox(0,"2*3",_Multiply(2,3))
MsgBox(0,"9/3",_Division(9,3))
MsgBox(0,"5^2",_Pow(5,2))

Func _Pow(\$f1,\$f2)
For \$i=0 To \$f2-1
Next
EndFunc

Func _Multiply(\$f1,\$f2)
For \$i=0 To \$f2-1
Next
EndFunc

Func _Division(\$f1,\$f2)
If \$f2=0 Then Return "1.#INF"
While \$f1>0
\$f1-=\$f2
WEnd
If \$f1<0 Then
EndIf
EndFunc```
Edited by monoceres

Broken link? PM me and I'll send you the file!

##### Share on other sites

So you didn't read the help file from front to back like everyone else?

No see, I knew it is there because I have used it before, but... I forgot about it today!

## Create an account

Register a new account