Skip to content

Instantly share code, notes, and snippets.

@mwmitchell
Created February 9, 2012 02:07
Show Gist options
  • Save mwmitchell/1776499 to your computer and use it in GitHub Desktop.
Save mwmitchell/1776499 to your computer and use it in GitHub Desktop.
division expansion 2
(defn de2 [x n]
(concat
(map (constantly (int (quot x n))) (range (- n 1)))
[(int (java.lang.Math/ceil (/ x n)))]))
(de2 7 2)
(de2 10 2)
(de2 10 5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment