Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,26 +0,0 @@
|
|||
;AutoIt Version: 3.2.10.0
|
||||
$A=4913
|
||||
$n=3
|
||||
$x=20
|
||||
ConsoleWrite ($n& " root of "& $A & " is " &nth_root_it($A,$n,$x))
|
||||
ConsoleWrite ($n& " root of "& $A & " is " &nth_root_rec($A,$n,$x))
|
||||
|
||||
;Iterative
|
||||
Func nth_root_it($A,$n,$x)
|
||||
$x0="0"
|
||||
While StringCompare(string($x0),string($x))
|
||||
ConsoleWrite ($x&@CRLF)
|
||||
$x0=$x
|
||||
$x=((($n-1)*$x)+($A/$x^($n-1)))/$n
|
||||
WEnd
|
||||
Return $x
|
||||
EndFunc
|
||||
|
||||
;Recursive
|
||||
Func nth_root_rec($A,$n,$x)
|
||||
ConsoleWrite ($x&@CRLF)
|
||||
If $x==((($n-1)*$x)+($A/$x^($n-1)))/$n Then
|
||||
Return $x
|
||||
EndIf
|
||||
Return nth_root_rec($A,$n,((($n-1)*$x)+($A/$x^($n-1)))/$n)
|
||||
EndFunc
|
||||
Loading…
Add table
Add a link
Reference in a new issue