Created
May 8, 2020 01:37
-
-
Save pazthor/0c5414537788e5408cb1a45f0354e84c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//fsx | |
// sumar una lista de elementos elevados al qubo | |
let square n= n*n | |
let alCubo n = (square n) * n | |
alCubo (-3) | |
alCubo (abs -3) | |
let list = [1;2;3;4] | |
let list' = [-2 .. 2] | |
let result = list |> List.map alCubo |> List.sum | |
let result' = list|> List.sumBy alCubo | |
let result''= list' |> List.map abs |> List.sumBy alCubo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Interesante detalle ese de cubo n = (square n) * n 👍