DaProgrammer Posted August 20, 2007 Share Posted August 20, 2007 (edited) div.au3expandcollapse popup;=============================================================================== ; ; Function Name: _Div() ; Description: Devides $Num by $Devidant. ; Parameter(s): $Num - The Number you are deviding. ; $Devidant - The Number you are deviding by. ; ; $Result[0] - The Whole Result ; $Result[1] - The remainder. ; ; Requirement(s): None. ; Return Value(s): The Whole Number and the remainder. ; @error is set to 1 if Devidant = 0. ; Author(s): KJ ; ;=============================================================================== Func _Div($Num,$Devidant) Local $Result[2] If $Num < 0 Then $Num = -$Num If $Devidant < 0 Then $Devidant = -$Devidant If $Devidant = 0 Then SetError(1) Return EndIf If $Num > $Devidant Then $Result[0] = Floor($Num/$Devidant) $Result[1] = $Num - ($Result[0]*$Devidant) ElseIf $Num = $Devidant Then $Result[0] = 1 $Result[1] = 0 ElseIf $Num < $Devidant Then $Result[0] = 0 $Result[1] = $Num EndIf Return $Result EndFuncSample.au3#include "div.au3" $a=_Div(50,9) If @error=0 Then MsgBox(0,"",$a[0] & " " & $a[1])what u all think ?i personally think it should be addded to the autoit user functions. Edited August 20, 2007 by DaProgrammer Link to comment Share on other sites More sharing options...
James Posted August 20, 2007 Share Posted August 20, 2007 Its divide. Nice work 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