Y
Hacker News
new
|
ask
|
show
|
jobs
by
Dewie
4704 days ago
GForth uses 0 for 'false' but -1 for 'true'... that confuses me a lot.
3 comments
kybernetikos
4704 days ago
I expect that it's because in twos complement representation -1 is represented as all bits set.
link
IanCal
4704 days ago
I suppose it's because then it can just compare the first bit.
link
dlitz
4704 days ago
BASIC does that, too.
link