Hi
Does anyone know how to use natural log or exponential formulas in C#. They will work in a normal Visual basic program but when I try to put them into a Netduino application I cant.
Thanks
Danny
Math Problem
Started by Danny, Apr 30 2011 05:04 PM
1 reply to this topic
#1
Posted 30 April 2011 - 05:04 PM
#2
Posted 30 April 2011 - 05:51 PM
Hi Danny.
The math is actually a weak point of the MF.
If you are in a hurry, you may pick the C# sources of several math functions from the "Trigo" class here.
However, some of these functions could give unpredictable result if the argument is outside certain bounds.
I have began checking function by function and modifying the ones so that could be acceptable. I have no finished yet, though.
I have rewritten both the Exp and the Log functions, but unfortunately I haven't the sources here.
The Trig's Log is pretty good, but the Exp gives an huge error yet for inputs < -5 and > 5.
Hope it helps.
Cheers
The math is actually a weak point of the MF.
If you are in a hurry, you may pick the C# sources of several math functions from the "Trigo" class here.
However, some of these functions could give unpredictable result if the argument is outside certain bounds.
I have began checking function by function and modifying the ones so that could be acceptable. I have no finished yet, though.
I have rewritten both the Exp and the Log functions, but unfortunately I haven't the sources here.
The Trig's Log is pretty good, but the Exp gives an huge error yet for inputs < -5 and > 5.
Hope it helps.
Cheers
Biggest fault of Netduino? It runs by electricity.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users