Shop OBEX P1 Docs P2 Docs Learn Events
Floating point compare — Parallax Forums

Floating point compare

grasshoppergrasshopper Posts: 438
edited 2008-09-11 21:52 in Propeller 1
Can some one point me in the right direction.

I wish to compare some thing like the following. I have a array that I create a floating point string from called floating_point_var



x := floating_Point_Var

if (X > 10.00)
   do something

if ( X < 9.99)
  do something else





Any help is always loved

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-11 21:36
    You need to download the Floating Point Library from the Propeller Object Exchange. It has a floating point compare routine that subtracts two floating point numbers and returns -1, 0, or 1 depending on the result of the subtraction and you do a "if ... < 0" or the like.
  • grasshoppergrasshopper Posts: 438
    edited 2008-09-11 21:52
    Thanks Mike but i cant seem to locate the Object, hum...
Sign In or Register to comment.