Are hyperbolic functions supported in .NET CF?

G

Guest

H

In the documentation it states Math.cosh is supported by the .NET Compact Framework. But if a add the line to my application

Math.cosh(0.34

I will get the error message: Run-time exception thrown : System.NotSupportedException - NotSupportedExceptio

Is the documentation wrong

Gavin
 
A

Alex Feinman [MVP]

This is one of those confusing "Supported by API/Not supported by platform
cases". The class definition (Math) has it for compatibility, but will throw
an exception when you try using it. Luckily all hyperbolic functions are
easily represented via exponential function:

sinh(x) = (exp(x) - exp(-x))/2
cosh(x) = (exp(x) + exp(-x))/2
tanh(x) = (exp(x) - exp(-x))/(exp(x) + exp(-x))

and Exp is present and implemented. Similarly, reverse hyperbolic functions
can also be represented via more basic functions:
asinh(z) = log(z + sqrt(z*z +1))
etc...

Gavin said:
Hi

In the documentation it states Math.cosh is supported by the .NET Compact
Framework. But if a add the line to my application:
Math.cosh(0.34)

I will get the error message: Run-time exception thrown :
System.NotSupportedException - NotSupportedException
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top