Are hyperbolic functions supported in .NET CF?

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Back
Top