Skip to content

Instantly share code, notes, and snippets.

@evanlouie
Last active October 19, 2017 22:36
Show Gist options
  • Save evanlouie/e1bd2517741fae1f1eb9b063d05fed31 to your computer and use it in GitHub Desktop.
Save evanlouie/e1bd2517741fae1f1eb9b063d05fed31 to your computer and use it in GitHub Desktop.
# functional
Enum.sum(Integer.digits(trunc(:math.pow(2,1000))))
# Pipe
:math.pow(2,1000) |> trunc |> Integer.digits |> Enum.reduce(&(&1+&2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment