POV-Ray : Newsgroups : povray.general : 2^3*4^4: quick what is it? Server Time
8 Aug 2024 18:22:02 EDT (-0400)
  2^3*4^4: quick what is it? (Message 11 to 20 of 33)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Greg M  Johnson
Subject: Re: 2^3*4^4: quick what is it?
Date: 29 Nov 2000 19:55:22
Message: <3a25a57a@news.povray.org>
Ron Parker wrote:

> It's worth noting that this is not a question for .general.


since it's a math question, but then again povray.new-users since it's a stupidly
simply one, or even povray.off-topic, but the experts like Ron aren't subscribed

declarations in 3.1g.

:-|


Post a reply to this message

From: Steve
Subject: Re: 2^3*4^4: quick what is it?
Date: 29 Nov 2000 20:13:08
Message: <slrn92b7kt.lqg.steve@zero-pps.localdomain>
In perl I get:

my $Calculator = 2^3*4^4;
print "$Calculator\n\n";

  This prints 10

$Calculator = (2^3*4^4);
print "$Calculator\n\n";

  This prints 10

$Calculator = (2^3)*(4^4);
print "$Calculator\n\n";

  This prints 0

$Calculator = ((2^3)*(4^4));
print "$Calculator\n\n";

  This prints 0

$Calculator = 2^(3*4)^4;
print "$Calculator\n\n";

  This prints 10 


-- 
Cheers
Steve              email mailto:ste### [at] zeroppsuklinuxnet

%HAV-A-NICEDAY Error not enough coffee  0 pps. 

web http://www.zeropps.uklinux.net/

or  http://start.at/zero-pps

 10:55pm  up 50 days,  1:19,  2 users,  load average: 1.08, 1.09, 1.03


Post a reply to this message

From: Alex Vandiver
Subject: Re: 2^3*4^4: quick what is it?
Date: 29 Nov 2000 21:17:23
Message: <3A25B889.52E0F95F@tiac.net>
Steve wrote:
> In perl I get:
> 
> my $Calculator = 2^3*4^4;
> print "$Calculator\n\n";
> 
>   This prints 10
> [snip] 
Looks like you need to reread perlop.  The caret (^) in Perl is the
bitwise exclusive or.  Using ** will give you the expected answers.
HTH,
-Alex V.


Post a reply to this message

From: Ken
Subject: Re: 2^3*4^4: quick what is it?
Date: 29 Nov 2000 22:38:26
Message: <3A25CC61.96232DF0@pacbell.net>
"Greg M. Johnson" wrote:
> 
> Ron Parker wrote:
> 
> > It's worth noting that this is not a question for .general.
> 
> Okeleeedoke.  I expected a criticsm for not putting this in povray.advanced-users,
> since it's a math question, but then again povray.new-users since it's a stupidly
> simply one, or even povray.off-topic, but the experts like Ron aren't subscribed
> to that anymore,  AND I didn't realize that the ^ was inoperative for general
> declarations in 3.1g.

Don't let it upset you too much. I think Ron is just having a bad hair day.

*BUT* he does bring up a valid point. Whenever an inconsistency arises
in one of the unofficial versions of the program they should indeed be
discussed in the unofficial patches group. That fact you were using
MegaPov when the problem occured should have been your first clue on
where to post the message. A good reason for this is when someone like
Ron, a member of the POV-Team, sees a question like this arise he may
be tempted to spend time looking at the source code for POV-Ray and try
to understand where the inconstancy lies. If he wastes his time looking
in the official source code, for problems that don't apply to it, he may
not be so generous next time trying to be of help. It is a matter of
courtesy to him, and the other Team members who monitor and maintain
these groups, to try to help keep them organized and on topic.

-- 
Ken Tyler


Post a reply to this message

From: Ron Parker
Subject: Re: 2^3*4^4: quick what is it?
Date: 30 Nov 2000 00:38:01
Message: <slrn92bptt.kl9.ron.parker@fwi.com>
On Wed, 29 Nov 2000 19:41:21 -0800, Ken wrote:
>Don't let it upset you too much. I think Ron is just having a bad hair day.

Well, yes... annual performance reviews at work and all.  The good news
is, I still have a job. :)

>Ron, a member of the POV-Team, sees a question like this arise he may
>be tempted to spend time looking at the source code for POV-Ray and try
>to understand where the inconstancy lies. If he wastes his time looking

And that's exactly what I did; I spent several minutes grepping for 
HAT_TOKEN and not finding anything.  It's just as well, though: the
new functionality has been merged into 3.5, so it needs to be fixed 
there.

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


Post a reply to this message

From: Greg M  Johnson
Subject: Re: 2^3*4^4: quick what is it?
Date: 30 Nov 2000 08:56:13
Message: <3A265B2C.5ED7B4D@my-dejanews.com>
Ron Parker wrote:

> >Ron, a member of the POV-Team, sees a question like this arise he may
> >be tempted to spend time looking at the source code for POV-Ray and try
> >to understand where the inconstancy lies. If he wastes his time looking
>
> And that's exactly what I did; I spent several minutes grepping for
> HAT_TOKEN and not finding anything.  It's just as well, though: the
> new functionality has been merged into 3.5, so it needs to be fixed
> there.

Sorry mons.

I guess I thought the introduction of ^ was so cool and so necessary [as opposed
to pow(a,b)] that I forgot it wasn't in 3.1g.


Post a reply to this message

From: Greg M  Johnson
Subject: Re: 2^3*4^4: quick what is it?
Date: 30 Nov 2000 08:59:12
Message: <3A265BDF.F9D1FC88@my-dejanews.com>
Matt Giwer wrote:

>         When in doubt use parenthesis. They rule.

I was going so wacky with parens that I was second-guessing myself and adding
2 or 3 extra pairs to every equation.


Post a reply to this message

From: Ken
Subject: Re: 2^3*4^4: quick what is it?
Date: 30 Nov 2000 11:03:29
Message: <3A267B03.70722769@pacbell.net>
"Greg M. Johnson" wrote:
> 
> It is interesting that when I do a #debug for a variable which I have
> declared as  [ #declare angie=2^3*4^4;]
> povray tells me it is 1084576,  when I paste this text (2^3*4^4) into
> Lotus1-2-3, the result is 2048.

Just out of curiosity if you know the answer is 2048 why don't you
just put 2048 in as your declared value ? Sure would make your
code more readable.

<duck>


Post a reply to this message

From: Matt Giwer
Subject: Re: 2^3*4^4: quick what is it?
Date: 30 Nov 2000 16:53:47
Message: <3A26CC6B.E60B569B@ij.net>
"Greg M. Johnson" wrote:
> 
> Matt Giwer wrote:
> 
> >         When in doubt use parenthesis. They rule.
> 
> I was going so wacky with parens that I was second-guessing myself and adding
> 2 or 3 extra pairs to every equation.

	It is worth it to remove all doubt and certainly faster than working
through the evaluation hierarchy if it isn't second nature to you. 

-- 
I would rather hide behind freedom of speech than
behind maudlin self-righteousness. 
	-- Cabell W. Johnson, 7


Post a reply to this message

From: Warp
Subject: Re: 2^3*4^4: quick what is it?
Date: 30 Nov 2000 17:54:26
Message: <3a26daa2@news.povray.org>
Ken <tyl### [at] pacbellnet> wrote:
: Just out of curiosity if you know the answer is 2048 why don't you
: just put 2048 in as your declared value ? Sure would make your
: code more readable.

  Sometimes putting the result is less readable than putting the calculation
used to get the result.

  For example, I bet that this:

sphere { <1,2,3>*.25, 10*.25 }

tells you more about what is happening than this:

sphere { <.25, .5, .75>, 2.5 }

-- 
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.