Skip to content

Instantly share code, notes, and snippets.

@davidcoallier
Created June 2, 2010 16:12
Show Gist options
  • Save davidcoallier/422599 to your computer and use it in GitHub Desktop.
Save davidcoallier/422599 to your computer and use it in GitHub Desktop.
pow(A, B) when is_integer(B), B >= 0 -> pow(A, B, 1);
pow(A, B) when is_integer(B) -> 1 / pow(A, -B, 1);
pow(A, B) when is_float(B) -> math:pow(A, B).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment