Shop OBEX P1 Docs P2 Docs Learn Events
BS2sx Natural Log function??? — Parallax Forums

BS2sx Natural Log function???

Sarah RoseSarah Rose Posts: 7
edited 2008-03-21 03:59 in BASIC Stamp
I know that the RCTIME function uses ln() in its calculations,

but is it possible to have it compute a natural log in your code?

As in, could you write a code and make one variable the natural log of 2 others?

Ex: 3 = ln(1/2)

Thanks,
Sarah

Comments

  • Sarah RoseSarah Rose Posts: 7
    edited 2008-03-20 21:59
    Hm..can it even do exponential functions? I think I'm realizing it cannot...
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2008-03-21 03:59
    Hi Sarah,

    The Stamp does have integer base 2 log and exp functions, but they are called ncd and dcd and their function as log and exp is not immediately apparent. There is an explanation of how it works and also how to compute the functions with greater accuracy at this URL:

    [noparse][[/noparse]urlhttp://www.emesystems.com/BS2math3.htm

    Also, for an application that uses the logs to calculate dew point temperature, see
    www.emesystems.com/OL2sht1x.htm
    -- the dew point stuff is near the bottom of the page.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.