Sujet : Re: basic BASIC question
De : cross (at) *nospam* spitfire.i.gajendra.net (Dan Cross)
Groupes : comp.os.vmsDate : 31. Jan 2025, 23:07:54
Autres entêtes
Organisation : PANIX Public Access Internet and UNIX, NYC
Message-ID : <vnjhjq$gk1$2@reader2.panix.com>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <
vnjat2$3hjku$1@dont-email.me>,
Chris Townley <
news@cct-net.co.uk> wrote:
On 31/01/2025 19:24, Dan Cross wrote:
In article <679d001e$0$713$14726298@news.sunsite.dk>,
Arne Vajhøj <arne@vajhoej.dk> wrote:
On 1/31/2025 11:39 AM, Dave Froble wrote:
On 1/31/2025 10:18 AM, Arne Vajhøj wrote:
Is it common to use:
>
declare integer constant TRUE = -1
declare integer constant FALSE = 0
>
>
?
>
It works. Doesn't really matter if declared a constant. Zero is false,
anything else is true. Using 1 vs -1 has been more my experience.
>
I got the impression that the manual/compiler prefer -1 over 1.
>
print not 0%
>
does print -1.
This sort of makes some sense when one considers the bit
representation of `-1` on a 2s complement machine (all bits 1).
>
That was my understanding, a bitwise True and False should return zero
(False)
Surely the same is true of 0 and 1, though? Perhaps a bitwise
AND of some value and TRUE should never be 0 unless that value
is 0.
- Dan C.