James Posted July 19, 2008 Share Posted July 19, 2008 (edited) 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 July 19, 2008 by JamesBrooks Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
BrettF Posted July 19, 2008 Share Posted July 19, 2008 According to http://www.cafeaulait.org/course/week4/40.html it is... muttley Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
James Posted July 19, 2008 Author Share Posted July 19, 2008 (edited) 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 July 19, 2008 by JamesBrooks Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Richard Robertson Posted July 19, 2008 Share Posted July 19, 2008 Pow doesn't need to be added because the operator has been there for a LONG time. Link to comment Share on other sites More sharing options...
James Posted July 19, 2008 Author Share Posted July 19, 2008 ^, just realised. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Richard Robertson Posted July 19, 2008 Share Posted July 19, 2008 So you didn't read the help file from front to back like everyone else? Link to comment Share on other sites More sharing options...
monoceres Posted July 19, 2008 Share Posted July 19, 2008 (edited) 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) Local $answer=1 For $i=0 To $f2-1 $answer=_Multiply($answer,$f1) Next Return $answer EndFunc Func _Multiply($f1,$f2) Local $answer=0 For $i=0 To $f2-1 $answer+=$f1 Next Return $answer EndFunc Func _Division($f1,$f2) If $f2=0 Then Return "1.#INF" Local $answer=0 While $f1>0 $answer+=1 $f1-=$f2 WEnd If $f1<0 Then $answer-=1 EndIf Return $answer EndFunc Edited July 19, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
James Posted July 19, 2008 Author Share Posted July 19, 2008 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! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now