How do I do exponents in Scheme?

Claudiu picture Claudiu · Nov 6, 2009 · Viewed 36.3k times · Source

pow, ^, ** doesn't work, and Scheme seems to be too common a word to be able to effectively google it.

Answer

Laurence Gonsalves picture Laurence Gonsalves · Nov 6, 2009

From R5RS Standard Pocedures:

(expt z1 z2) 

Returns z1 raised to the power z2. For z1 0

z1z2 = ez2 log z1

0z is 1 if z = 0 and 0 otherwise.

Searching for "scheme reference" turns up this document.