Shop OBEX P1 Docs P2 Docs Learn Events
Floating Point Numbers? — Parallax Forums

Floating Point Numbers?

Marz KrishnaMarz Krishna Posts: 26
edited 2009-08-11 23:12 in BASIC Stamp
Is there an easy way to work with floating point numbers? Maybe a library someone has made? confused.gif

Comments

  • Marz KrishnaMarz Krishna Posts: 26
    edited 2009-08-11 22:46
    I'de even settle for Fixed point.
  • FranklinFranklin Posts: 4,747
    edited 2009-08-11 23:09
    Integer math only. you can print out pseudo FP by multiplying by 100 and then stripping off the last two digits.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Mike GreenMike Green Posts: 23,101
    edited 2009-08-11 23:12
    Tracy Allen's website (www.emesystems.com under "app-notes" link) discusses multiple precision and fixed point arithmetic. As Franklin indicated, the Stamps provide 16-bit unsigned integer arithmetic only (with some special cases for multiplication and division). It's common to used fixed point arithmetic and you have to adjust the values you're working with to account for scaling changes.
Sign In or Register to comment.