user3442585
user3442585

Reputation:

How can I create a power function with negative exponent in Clojure?

I've seen many ways to develop a power function in Clojure (recursion, using reduce, loop, etc), but none of them accepts negative exponents...

Can I do this without depending on Java's Math/pow?

Upvotes: 1

Views: 1019

Answers (1)

Shlomi
Shlomi

Reputation: 4748

Here is a hint of how you could use the regular algorithms:

the hint

Upvotes: 5

Related Questions