Skip to content

Instantly share code, notes, and snippets.

@federicobucchi
Created November 6, 2014 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save federicobucchi/d575a9ca13accebfcd9a to your computer and use it in GitHub Desktop.
Save federicobucchi/d575a9ca13accebfcd9a to your computer and use it in GitHub Desktop.
Custom modulus function
def custom_mod(input)
arr = input.split(',')
number = arr[0].to_i
divisory = arr[1].to_i
n_times = number / divisory
res_molt = divisory * n_times
return number - res_molt
end
custom_mod('20, 3')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment