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
defmodule ReverseFactorial do | |
def calc(base_num, factorial \\ 2) do | |
case base_num/factorial do | |
1.0 -> factorial | |
x -> if (base_num/factorial) == div(round(base_num), factorial), do: calc(x, factorial + 1), else: "NONE" | |
end | |
end | |
end |
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
### Keybase proof | |
I hereby claim: | |
* I am calebshay on github. | |
* I am calebshay (https://keybase.io/calebshay) on keybase. | |
* I have a public key whose fingerprint is EBD4 1FA3 6034 C140 E447 DDE5 1170 72F1 5692 EE56 | |
To claim this, I am signing this object: |