![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Warp
Subject: Why & has higher precedence than + or - in isosurface functions?
Date: 31 Jul 2000 09:03:01
Message: <39857905@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Is there a reason for the operator & having higher precedence than + or -
in isosurface functions?
The equivalent operator in logic (the one that looks like an upside down 'V')
hasn't, and it would be natural to have the same precedence in isosurface
functions.
If I write this function:
function { x+y & y+z }
at least I read it in the same way as in mathematics (I'll use '&' here, but
imagine that it's the upside down 'V'):
x+y=0 & y+z=0
However the current isosurface implementation reads it this way:
x+(y&y)+z
--
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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Thorsten Froehlich
Subject: Re: Why & has higher precedence than + or - in isosurface functions?
Date: 31 Jul 2000 12:37:30
Message: <3985ab4a$1@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <39857905@news.povray.org> , Warp <war### [at] tag povray org> wrote:
> Is there a reason for the operator & having higher precedence than + or - in
> isosurface functions?
This looks like a bug to me, it should have lower precedence.
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Thorsten Froehlich wrote:
>
> In article <39857905@news.povray.org> , Warp <war### [at] tag povray org> wrote:
>
> > Is there a reason for the operator & having higher precedence than + or - in
> > isosurface functions?
>
> This looks like a bug to me, it should have lower precedence.
is "&" supposed to be the AND logical operator??It seems so,and if it
is, then it's normal: boolean operator have higher precedence than
arithmetical ones in almost all languages(and Maths); if not, then it's
a bug...
Could somebody explain why the patch uses "^" for something else than
exponents??
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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Thorsten Froehlich
Subject: Re: Why & has higher precedence than + or - in isosurface functions?
Date: 31 Jul 2000 14:50:47
Message: <3985ca87@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <3985C626.46C5B6E8@videotron.ca> , pk <thi### [at] videotron ca>
wrote:
> Could somebody explain why the patch uses "^" for something else than
> exponents??
As far as I know it does not use it for anything else...
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Thorsten Froehlich wrote:
>
> In article <3985C626.46C5B6E8@videotron.ca> , pk <thi### [at] videotron ca>
> wrote:
>
> > Could somebody explain why the patch uses "^" for something else than
> > exponents??
>
> As far as I know it does not use it for anything else...
Then, why did warp say "^"(that's an inverted V, right?) does the
opposite of &?
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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Mon, 31 Jul 2000 14:59:53 -0400, pk wrote:
>Thorsten Froehlich wrote:
>>
>> In article <3985C626.46C5B6E8@videotron.ca> , pk <thi### [at] videotron ca>
>> wrote:
>>
>> > Could somebody explain why the patch uses "^" for something else than
>> > exponents??
>>
>> As far as I know it does not use it for anything else...
>Then, why did warp say "^"(that's an inverted V, right?) does the
>opposite of &?
He was referring to the mathematical symbol that looks like an inverted V.
That symbol represents logical "and", and looks nothing like a caret.
--
Ron Parker http://www2.fwi.com/~parkerr/traces.html
My opinions. Mine. Not anyone else's.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 31 Jul 2000 09:03:01 -0400, Warp <war### [at] tag povray org> wrote:
> Is there a reason for the operator & having higher precedence than + or -
>in isosurface functions?
Well, for me & has always meant binary 'and' or binary multiplication.
As such I find it logical for it to have a higher precedence than
addition. Your mileage may vary but that largely depends on the
programming languages you're most comfortable with :)
Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usa net
TAG e-mail : pet### [at] tag povray org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Thorsten Froehlich
Subject: Re: Why & has higher precedence than + or - in isosurface functions?
Date: 31 Jul 2000 15:51:58
Message: <3985d8de@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <mj1bos4rmn9url4dp0shdmegjdron19h8b@4ax.com> , Peter Popov
<pet### [at] usa net> wrote:
>> Is there a reason for the operator & having higher precedence than + or -
>>in isosurface functions?
>
> Well, for me & has always meant binary 'and' or binary multiplication.
> As such I find it logical for it to have a higher precedence than
> addition. Your mileage may vary but that largely depends on the
> programming languages you're most comfortable with :)
No, both, binary and logical and should have lower precedence. If it is
binary it could at most have the same precedence to make any sense at all.
If you look at various programming languages you will find that all current
ones obey the rules set by mathematics.
As for binary operations, I think a dot=and, a plus=or and a line above=not
are very common or even standard. In this case a 'and' has higher
precedence, but this has little to do with general math and is not related.
The & sign in isosurfaces is obviously the equivalent of the inverted-V, and
thus it should have lower precedence. As for the not inverted-V, the '|'
(or-sign), I am not sure about the current implementation, but is should
also have lower precedence.
Thorsten
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Warp
Subject: Re: Why & has higher precedence than + or - in isosurface functions?
Date: 1 Aug 2000 06:24:26
Message: <3986a55a@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Thorsten Froehlich <tho### [at] trf de> wrote:
: The & sign in isosurfaces is obviously the equivalent of the inverted-V, and
: thus it should have lower precedence. As for the not inverted-V, the '|'
: (or-sign), I am not sure about the current implementation, but is should
: also have lower precedence.
Also | should have lower precedence than &, so if we have this:
x-y | y-z & x+z
it should be interpreted in this way:
(x-y) | ((y-z) & (x+z))
In this way it will be consistent with mathematics.
--
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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
From: Thorsten Froehlich
Subject: Re: Why & has higher precedence than + or - in isosurface functions?
Date: 1 Aug 2000 07:45:21
Message: <3986b851$1@news.povray.org>
|
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
In article <3986a55a@news.povray.org> , Warp <war### [at] tag povray org> wrote:
> Also | should have lower precedence than &, so if we have this:
>
> x-y | y-z & x+z
>
> it should be interpreted in this way:
>
> (x-y) | ((y-z) & (x+z))
>
> In this way it will be consistent with mathematics.
I agree.
____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trf de
Visit POV-Ray on the web: http://mac.povray.org
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |