Why Yes equals minus one?

  • Thread starter Thread starter Telesphore
  • Start date Start date
Why "Yes" equals -1?

Thanks

OiOiOiOiOi

There have been waged religious wars about this subject..

The best explanation I can offer to you is that in the original BASIC,
the inventors Kurtz and Kemeny just decided to do it this way.
It is simply a *convention* that has endured th 40 years since the
original development of BASIC.

To be very exact, TRUE is every number <> 0 (not just -1).

Everybody else (speaking of C/C++, etc) has defined

TRUE = +1

So, my advice is: Please don't worry, there is no mystery behind this,
just get used to it as a fact when you are working in BASIC.

HTH
Matthias Kläy
 
Back
Top