-1

New to programming and have a question regarding defining an equation that is a fraction and has exponents.

This is the question:

Define a function tanh which, given a positive number x , returns the hyperbolic tangent of x defined as tanh(x ) = (e^2x − 1)/(e^2x + 1)

You may use the built in SCHEME function (expt b e) function to complete this problem. (expt b e) computes b^e

I understand that (expt b e) is how you write exponents, but I don't understand how to write "e^x".

1 Answers1

0

expt is the power function, whereas exp is the natural exponential function.

(exp x) gives you ex.

erkin
  • 535
  • 1
  • 5
  • 11