Re: Odd dog days & Vets
- From: "Hamish" <akc@xxxxxxxxxxxxxxx>
- Date: Mon, 26 Dec 2005 22:12:50 -0000
"Charles Francis" <charles@xxxxxxxxxxxxxxxx> wrote in message
news:3JBuduCBiFsDFwAA@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> 1 is true, 0 is false. I am a not little rusty. As I recall sometimes
> truth is determined by the last bit of byte, in which case any odd
> number would evaluate as true, and any odd number as false, but I think
> I generally worked in languages, or chips, in which any nonzero number
> evaluated as true.
>
It is generally bad programming to use or assume the underlying
representation of values.
Better to use only 'TRUE' and 'FALSE' in all the algorithms. I would not
trust the compiler to pack booleans to single bits.
It is probably true that FALSE == 0 and TRUE is > 0.
I would (in c) use:
#define TRUE 1
#define FALSE 0
if I wanted to be sure of the representation.
.
- Follow-Ups:
- Machine code for farmers who want their heads to spin.
- From: Charles Francis
- Machine code for farmers who want their heads to spin.
- References:
- Re: Odd dog days & Vets
- From: Charles Francis
- Re: Odd dog days & Vets
- Prev by Date: Re: Odd dog days & Vets
- Next by Date: Re: Haslingden
- Previous by thread: Re: Odd dog days & Vets
- Next by thread: Machine code for farmers who want their heads to spin.
- Index(es):
Relevant Pages
|