Nth root: Difference between revisions

No change in size ,  4 years ago
m
→‎{{header|Haskell}}: Small reduction.
m (→‎{{header|Wren}}: More appropriate variable name: pair -> trio.)
m (→‎{{header|Haskell}}: Small reduction.)
Line 1,490:
until
(uncurry (==))
(((,) <*> ((/ n) . ((+) <$>. ((n - 1) *) <*> (x /) . (** (n - 1))))) . snd)
(x, x / n)
 
-- TESTS --------------------------------------------------
main :: IO ()
Line 1,503:
(uncurry nthRoot)
[(2, 2), (5, 34), (10, 734 ^ 10), (0.5, 7)]
 
-- FORMAT OF RESULTS --------------------------------------
fTable :: String -> (a -> String) -> (b -> String) -> (a -> b) -> [a] -> String
9,655

edits