Shop OBEX P1 Docs P2 Docs Learn Events
Can BASIC Stamp 2 display decimal point number — Parallax Forums

Can BASIC Stamp 2 display decimal point number

nuranura Posts: 1
edited 2008-01-23 03:58 in BASIC Stamp
hi, I am wondering if it's possible to display the decimal number. Currently, I can't make the BS2 to detect decimal point numbers as I plan to convert the binary value to decimal value. When I run the program, it would display Expected':' or End of line, on the decimal point. I would appreciate if someone would clarify this matter..thanks!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-01-23 03:58
    Parallax Stamp Basic does not allow decimal points in numbers. All numbers are integers without decimal points. It is possible to handle decimal points as characters and to display (and accept) numbers with decimal points, but not with the built-in number handling. The numbers have to be represented internally as integers or as character strings. This website (www.emesystems.com) has a lot of excellent discussion on multiple precision and fixed point decimal arithmetic.
Sign In or Register to comment.