views:

367

answers:

3

Hi!

I'm devolping on Compact Framework 2.0 SP1 and when I try to use Math.Sinh it throws me a Not Supported Exception

If I can't use this function, is there any other alternative?

Thanks!

A: 

Look at the PInvoke signatures of Math.Sin for example, I suspect Sinh would be there on the mobile device, but just not mapped/imported into the CF to save a byte or 2.

leppie
They are not P/Invoked. They are marked as InternalCall (implemented in the CLR itself)
Mehrdad Afshari
+5  A: 
sinh(x) = (e^x - e^-x) / 2

see wikipedia

So you should be able to write your own function !

Tom Carter
+1 yeah, I had forgotten the formula. No need to use Taylor series.
Mehrdad Afshari
+2  A: 

We use OpenNETCF to gain access to a lot of APIs that the Compact Framework just doesn't support. The Math package is just one of the them. Indeed, OpenNETCF does support the Sinh function.

OpenNETCF.Math2.Sinh(angle: double)

If you do a lot of work with the Compact Framework, the OpenNETCF Smart Device Framework can be very helpful.

Ken Wootton