Hi Lasse;
But in some computer languages these two statements are NOT the same because
the NOT operator sometimes takes precedence over the AND operator (it's one
level up in the hierarchy) and NOT A AND B is processed as (NOT A) AND B.
However, being fairly new to javascript, I can't seem to find any precedence
guidelines in the books I currently have. I wrote the attached HTML file
which shows (unless I made a mistake in my javascript coding) that these two
statements *are not* the same.
Charles...
"Cyberdog" <david.midcom@INVALID.com> wrote in message
news:jie7a0liu8e0vg4r70fftqofnhukqepes1@4ax.com...[color=blue]
> HI,
> I am learning javascript, and at the moment I am working on truth
> tables. Can someone please tell me, is "NOT A AND B" the same as "NOT A
> AND NOT B". Thanks[/color]
"Lasse Reichstein Nielsen" <lrn@hotpop.com> wrote in message
news:1xloci15.fsf@hotpop.com...[color=blue]
> Cyberdog <david.midcom@INVALID.com> writes:
>[color=green]
> > I am learning javascript, and at the moment I am working on truth
> > tables. Can someone please tell me, is "NOT A AND B" the same as "NOT A
> > AND NOT B".[/color]
>
> What are their truth tables?
>
> A | B | NOT A | NOT B | NOT A AND B | NOT A AND NOT B
> ------+-----+-------+-------+-------------+-----------------
> 1: true |true | false | false | false | false
> 2: true |false| false | true | false | false
> 3: false|true | true | false | true | false
> 4: false|false| true | true | false | true
>
> Remeber that the truth table for AND has true only when both
> operands are true. For NOT A AND B, that happens when both the
> NOT A and the B columns are true, which is row 3. For NOT A AND
> NOT B, both NOT A and NOT B are true in row 4.
>
> Since the two expressions have different truth tables, they are
> not the same.
>
> /L
> --
> Lasse Reichstein Nielsen -
lrn@hotpop.com
> DHTML Death Colors:[/color]
<URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>[color=blue]
> 'Faith without judgement merely degrades the spirit divine.'[/color]
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.683 / Virus Database: 445 - Release Date: 5/12/04