POV-Ray : Newsgroups : povray.unofficial.patches : Why & has higher precedence than + or - in isosurface functions? Server Time
2 Sep 2024 08:14:25 EDT (-0400)
  Why & has higher precedence than + or - in isosurface functions? (Message 12 to 21 of 41)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: pk
Subject: Re: Why & has higher precedence than + or - in isosurface functions?
Date: 1 Aug 2000 17:32:55
Message: <3987425C.687C7484@videotron.ca>
Ron Parker wrote:
> He was referring to the mathematical symbol that looks like an inverted V.
> That symbol represents logical "and", and looks nothing like a caret.
uh... I always thought + meant AND...
So, what's the opposite of AND? NAND? i don't think so....
--
AKA paul_virak_khuong at yahoo.com, pkhuong at deja.com, pkhuong at
crosswinds.net and pkhuong at technologist.com(list not complete)...


Post a reply to this message

From: pk
Subject: Re: Why & has higher precedence than + or - in isosurface functions?
Date: 1 Aug 2000 17:35:30
Message: <398742F7.4946312B@videotron.ca>
pk wrote:
> 
> Ron Parker wrote:
> > He was referring to the mathematical symbol that looks like an inverted V.
> > That symbol represents logical "and", and looks nothing like a caret.
> uh... I always thought + meant AND...
.... i meant to say:"i always thought * (well, dot with valign=center)
meant AND...
> So, what's the opposite of AND? NAND? i don't think so....
--
AKA paul_virak_khuong at yahoo.com, pkhuong at deja.com, pkhuong at
crosswinds.net and pkhuong at technologist.com(list not complete)...


Post a reply to this message

From: Ron Parker
Subject: Re: Why & has higher precedence than + or - in isosurface functions?
Date: 1 Aug 2000 17:52:15
Message: <slrn8oeib9.1u9.ron.parker@fwi.com>
On Tue, 01 Aug 2000 17:36:55 -0400, pk wrote:
>pk wrote:
>> 
>> Ron Parker wrote:
>> > He was referring to the mathematical symbol that looks like an inverted V.
>> > That symbol represents logical "and", and looks nothing like a caret.
>> uh... I always thought + meant AND...
>.... i meant to say:"i always thought * (well, dot with valign=center)
>meant AND...
>> So, what's the opposite of AND? NAND? i don't think so....

Well, the non-inverted V-like symbol that looks like the and symbol means
or.  I'm not sure why you're asking what the opposite is, though.

I suspect that the choice of symbology depends on what sort of logic class
you took.  I encountered the ^/V symbology in my pure mathematics classes,
and the dot/plus symbology in my CS classes.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

From: pk
Subject: Re: Why & has higher precedence than + or - in isosurface functions?
Date: 1 Aug 2000 18:57:39
Message: <39875639.A2E7C7A2@videotron.ca>
Ron Parker wrote:
> Well, the non-inverted V-like symbol that looks like the and symbol means
> or.  I'm not sure why you're asking what the opposite is, though.
> 
> I suspect that the choice of symbology depends on what sort of logic class
> you took.  I encountered the ^/V symbology in my pure mathematics classes,
> and the dot/plus symbology in my CS classes.
Ok, thanx!
Well, I was asking bc the original poster said something about the
opposite of "V upside down" 8)
And I haven't taken any logic class for the moment, only read some CS
books(CPU design, programming, etc)... It's coming this year, in
maths(I'm just going in 10th grade), so **** I'm gonna be a bit lost if
i don't remember that 8)

Thanks again!
--
AKA paul_virak_khuong at yahoo.com, pkhuong at deja.com, pkhuong at
crosswinds.net and pkhuong at technologist.com(list not complete)...


Post a reply to this message

From: Warp
Subject: Re: Why & has higher precedence than + or - in isosurface functions?
Date: 2 Aug 2000 05:09:57
Message: <3987e565@news.povray.org>
pk <thi### [at] videotronca> wrote:
:> uh... I always thought + meant AND...
: .... i meant to say:"i always thought * (well, dot with valign=center)
: meant AND...

  Nope, they don't mean the same thing.
  The function { x * y } is certainly not the same as function { x & y }
(you can render them if you want to see the difference).
  What you are saying in the first function is that a point <x,y,z> is inside
the shape if and only if x*y < 0.
  The the second case you are saying that a point <x,y,z> is inside the shape
if and only if x < 0 and y < 0.
  For example <-1,2,0> is inside the function { x * y } but it's not inside
the function { x & y }.

  The inverted V-looking operator (and I don't have any reason to believe
that & in isosurface functions is anything else) is a basic operator in
set theory. The same goes for | (which is the V-looking operator in set
theory and denotes union).

:> So, what's the opposite of AND? NAND? i don't think so....

  Basic set theory (I use & and | here because of the lack of the proper
characters):

  The inverse of A&B is -(A&B) ie. (-A)|(-B).

  Here '-' means "not" (ie. "not in the set"). That is, a point is not in
A&B if and only if it's either not in A or not in B (that is, it's not in
both at the same time).

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Warp
Subject: Re: Why & has higher precedence than + or - in isosurface functions?
Date: 2 Aug 2000 05:13:18
Message: <3987e62d@news.povray.org>
Peter Popov <pet### [at] usanet> wrote:
: I don't know why, it's just that when I see logic operators I think
: it's reasonable for them to expect boolean operands (promoted to
: boolean if needed). And with that in mind, I expect multiplication to
: have a higher precedence than addition, regardless of context.

  & and | are not boolean operators. The are set theory operators.

  When you write: function { x & y }
you are actually saying:

  x<0 AND y<0

not something like:

  (x LOGICAL_AND y) < 0

which makes little sense.

  What is (0.5 LOGICAL_AND -2.8)?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: pk
Subject: Re: Why & has higher precedence than + or - in isosurface functions?
Date: 2 Aug 2000 10:14:06
Message: <39882D08.E5E6F36A@videotron.ca>
Warp wrote:
> 
> pk <thi### [at] videotronca> wrote:
> :> uh... I always thought + meant AND...
> : .... i meant to say:"i always thought * (well, dot with valign=center)
> : meant AND...
> 
>   Nope, they don't mean the same thing.
>   The function { x * y } is certainly not the same as function { x & y }
> (you can render them if you want to see the difference).
>   What you are saying in the first function is that a point <x,y,z> is inside
> the shape if and only if x*y < 0.
>   The the second case you are saying that a point <x,y,z> is inside the shape
> if and only if x < 0 and y < 0.
>   For example <-1,2,0> is inside the function { x * y } but it's not inside
> the function { x & y }.
Yeah, well, as Mr Parker pointed out, logic operators in CS and Logic
Maths aren't the same 8(
In CS, if i remember right, "+" is OR, "*"(well, a dot that's in the
vertical middle of the line) mean AND, and a "-" that's above the line
means not...

I wasn't saying * meant something else than multiply in computer
languages(except maybe APL 8), but that before, in all the litterature
i've read, AND was written the same as you'd write * in algebra...

Can't they make out a standard?!?!?!??!

Oh, well,
 Paul
--
AKA paul_virak_khuong at yahoo.com, pkhuong at deja.com, pkhuong at
crosswinds.net and pkhuong at technologist.com(list not complete)...


Post a reply to this message

From: pk
Subject: Re: Why & has higher precedence than + or - in isosurface functions?
Date: 2 Aug 2000 10:24:36
Message: <39882F7E.6A2B29FE@videotron.ca>
Warp wrote:
> 
> Peter Popov <pet### [at] usanet> wrote:
> : I don't know why, it's just that when I see logic operators I think
> : it's reasonable for them to expect boolean operands (promoted to
> : boolean if needed). And with that in mind, I expect multiplication to
> : have a higher precedence than addition, regardless of context.
> 
>   & and | are not boolean operators. The are set theory operators.
> 
>   When you write: function { x & y }
> you are actually saying:
> 
>   x<0 AND y<0
> 
> not something like:
> 
>   (x LOGICAL_AND y) < 0
> 
> which makes little sense.
> 
>   What is (0.5 LOGICAL_AND -2.8)?
You've never made any programmation before, have you?
In most programming languages, they assign a value to TRUE, and another
to FALSE(in the case above, FALSE=0, and TRUE=NOT(FALSE) )
In other languages, fe, C(for which i dont't really remember the
standard), it's something like TRUE = -1 (binary 11111111) and FALSE
would be 0(binary 00000000)...

And, for your trivia, it depends: most languages will do logical
operations bit by bit, but i suppose that others have a Boolean
type(Java, fe i think), and will undercast it before doing the
LOGICAL_AND
And, yes, doing Logical operations bit by bit can be useful, and anyway,
you can just add a comparison operator before doing the boolean
operation... 

HTH,
 Paul
--
AKA paul_virak_khuong at yahoo.com, pkhuong at deja.com, pkhuong at
crosswinds.net and pkhuong at technologist.com(list not complete)...


Post a reply to this message

From: Peter Popov
Subject: Re: Why & has higher precedence than + or - in isosurface functions?
Date: 2 Aug 2000 10:32:43
Message: <u6cgossjcgm7mm5344obi02n837nqjrm82@4ax.com>
On 2 Aug 2000 05:13:18 -0400, Warp <war### [at] tagpovrayorg> wrote:

>  What is (0.5 LOGICAL_AND -2.8)?

!FALSE :))


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usanet
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Warp
Subject: Re: Why & has higher precedence than + or - in isosurface functions?
Date: 2 Aug 2000 11:02:18
Message: <398837f9@news.povray.org>
It doesn't matter how do you draw the symbol. The meaning should be clear
by now? & is the set theory intersection and | is union, right?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.