Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Math Problem


  • Please log in to reply
1 reply to this topic

#1 Danny

Danny

    Member

  • Members
  • PipPip
  • 10 posts

Posted 30 April 2011 - 05:04 PM

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

#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

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
Biggest fault of Netduino? It runs by electricity.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.