Nth root: Difference between revisions
m
→{{header|Haskell}}
Line 1,487:
<lang haskell>nthRoot :: Double -> Double -> Double
nthRoot n x =
let pn = pred n▼
until
▲ in fst $
(uncurry
▲ (((,) <*> ((/ n) . ((+) . (pn *) <*> (x /) . (** pn)))) . snd)
where
▲ (x, x / n)
-------------------------- TESTS --------------------------
|