Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Nth-root/Seed7/nth-root.seed7
Normal file
13
Task/Nth-root/Seed7/nth-root.seed7
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
const func float: nthRoot (in integer: n, in float: a) is func
|
||||
result
|
||||
var float: x1 is 0.0;
|
||||
local
|
||||
var float: x0 is 0.0;
|
||||
begin
|
||||
x0 := a;
|
||||
x1 := a / flt(n);
|
||||
while abs(x1 - x0) >= abs(x0 * 1.0E-9) do
|
||||
x0 := x1;
|
||||
x1 := (flt(pred(n)) * x0 + a / x0 ** pred(n)) / flt(n);
|
||||
end while;
|
||||
end func;
|
||||
Loading…
Add table
Add a link
Reference in a new issue