Nth root: Difference between revisions
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) . ((+)
(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
|