Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Nth-root/HicEst/nth-root.hicest
Normal file
19
Task/Nth-root/HicEst/nth-root.hicest
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
WRITE(Messagebox) NthRoot(5, 34)
|
||||
WRITE(Messagebox) NthRoot(10, 7131.5^10)
|
||||
|
||||
FUNCTION NthRoot(n, A)
|
||||
REAL :: prec = 0.001
|
||||
|
||||
IF( (n > 0) * (A > 0) ) THEN
|
||||
NthRoot = A / n
|
||||
DO i = 1, 1/prec
|
||||
x = ((n-1)*NthRoot + A/(NthRoot^(n-1))) / n
|
||||
IF( ABS(x - NthRoot) <= prec ) THEN
|
||||
RETURN
|
||||
ENDIF
|
||||
NthRoot = x
|
||||
ENDDO
|
||||
ENDIF
|
||||
|
||||
WRITE(Messagebox, Name) 'Cannot solve problem for:', prec, n, A
|
||||
END
|
||||
Loading…
Add table
Add a link
Reference in a new issue