Skip to content

Instantly share code, notes, and snippets.

@Radcliffe
Last active August 23, 2018 01:42
Show Gist options
  • Save Radcliffe/fd79a139d1f11008bfba9051140813ff to your computer and use it in GitHub Desktop.
Save Radcliffe/fd79a139d1f11008bfba9051140813ff to your computer and use it in GitHub Desktop.
Naive integer multiplication in Erlang
-module(multiply).
-export([mul/2]).
mul(_, 0) -> 0;
mul(A, B) -> mul(A, B-1) + A.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment