POV-Ray : Newsgroups : povray.unofficial.patches : Max and Min Server Time
2 Sep 2024 02:17:26 EDT (-0400)
  Max and Min (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Tom Melly
Subject: Max and Min
Date: 24 Aug 2000 16:57:29
Message: <39a58c39@news.povray.org>
Assume I'm a complete idiot - what do max and min do in functions, and what
is the syntax?

--
Tom Melly
tom### [at] tomandlucouk
http://www.tomandlu.co.uk


Post a reply to this message

From: Chris Huff
Subject: Re: Max and Min
Date: 24 Aug 2000 17:20:49
Message: <chrishuff-53993B.16221524082000@news.povray.org>
In article <39a58c39@news.povray.org>, "Tom Melly" 
<tom### [at] tomandluforce9couk> wrote:

> Assume I'm a complete idiot - what do max and min do in functions, 
> and what is the syntax?

They take two parameters. Min returns the lesser(minimum) of the two, 
and max returns the greater(maximum) of the two. The order of the 
parameters does not matter.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Tom Melly
Subject: Re: Max and Min
Date: 25 Aug 2000 04:27:44
Message: <39a62e00$1@news.povray.org>
"Chris Huff" <chr### [at] maccom> wrote in message
news:chrishuff-53993B.16221524082000@news.povray.org...
> In article <39a58c39@news.povray.org>, "Tom Melly"
> <tom### [at] tomandluforce9couk> wrote:
>
> > Assume I'm a complete idiot - what do max and min do in functions,
> > and what is the syntax?
>
> They take two parameters. Min returns the lesser(minimum) of the two,
> and max returns the greater(maximum) of the two. The order of the
> parameters does not matter.

Many thanks - I guessed this after posting but wasn't sure. I was initially
confused by looking up min and max in my dictionary of mathematics which
went on about horizontal tangents to a curve. Ah well.


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Max and Min
Date: 30 Aug 2000 10:43:00
Message: <39AD1C3E.5EC11E2F@my-dejanews.com>
Chris Huff wrote:

> They take two parameters. Min returns the lesser(minimum) of the two,
> and max returns the greater(maximum) of the two. The order of the
> parameters does not matter.

You're sure you don't have to put the smaller one in first?


Post a reply to this message

From: Chris Huff
Subject: Re: Max and Min
Date: 30 Aug 2000 10:50:03
Message: <chrishuff-CD08B3.09513730082000@news.povray.org>
In article <39AD1C3E.5EC11E2F@my-dejanews.com>, 
gre### [at] my-dejanewscom wrote:

> You're sure you don't have to put the smaller one in first?

I'm sure. It would kind of defeat the purpose of these functions if you 
had to know which one was smaller. :-)

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Tom Melly
Subject: Re: Max and Min
Date: 30 Aug 2000 10:52:17
Message: <39ad1fa1$1@news.povray.org>
"Greg M. Johnson" <gre### [at] my-dejanewscom> wrote in message
news:39AD1C3E.5EC11E2F@my-dejanews.com...
> Chris Huff wrote:
>
> > They take two parameters. Min returns the lesser(minimum) of the two,
> > and max returns the greater(maximum) of the two. The order of the
> > parameters does not matter.
>
> You're sure you don't have to put the smaller one in first?

But how do you know which is smaller? Don't they probably change? (And if
you do know and they don't change, why are using max and min). Here's your
badge I believe.


Post a reply to this message

From: Warp
Subject: Re: Max and Min
Date: 30 Aug 2000 10:52:29
Message: <39ad1fac@news.povray.org>
Greg M. Johnson <gre### [at] my-dejanewscom> wrote:
: You're sure you don't have to put the smaller one in first?

#macro GimmeTheMinimumOf(A, B)
  #if (A<B)
    #local result = min(A, B);
  #else
    #local result = min(B, A);
  #end
  result
#end


  (Hmm... a new form of povray humor?-) )

-- 
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: Christoph Hormann
Subject: Re: Max and Min
Date: 30 Aug 2000 11:24:11
Message: <39AD2759.9ABCA2C3@schunter.etc.tu-bs.de>
Warp wrote:
> 
> #macro GimmeTheMinimumOf(A, B)
>   #if (A<B)
>     #local result = min(A, B);
>   #else
>     #local result = min(B, A);
>   #end
>   result
> #end
> 
>   (Hmm... a new form of povray humor?-) )
> 

:-)

Although 'result' seems unnecessary and I prefer a bit of insecurity:

#declare Rnd=seed(1);

#macro I_am_not_so_sure_about_things(A, B)
  #if (rand(Rnd)<0.5)
    min(A, B)
  #else
    min(B, A)
  #end
#end

Christoph

--
Christoph Hormann <chr### [at] gmxde>
Homepage: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Max and Min
Date: 30 Aug 2000 14:34:11
Message: <39AD526E.C1139BBE@my-dejanews.com>
OH COME ON you guys!  I was poking fun at Chris' overly obvious statement:
it doesn't matter in which order you put the terms.

Chris Huff wrote:

> In article <39AD1C3E.5EC11E2F@my-dejanews.com>,
> gre### [at] my-dejanewscom wrote:
>
> > You're sure you don't have to put the smaller one in first?
>
> I'm sure. It would kind of defeat the purpose of these functions if you
> had to know which one was smaller. :-)
>
> --
> Christopher James Huff
> Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
> TAG: chr### [at] tagpovrayorg, http://tag.povray.org/
>
> <><


Post a reply to this message

From: Chris Huff
Subject: Re: Max and Min
Date: 30 Aug 2000 18:29:00
Message: <chrishuff-5324DE.17303430082000@news.povray.org>
In article <39AD526E.C1139BBE@my-dejanews.com>, 
gre### [at] my-dejanewscom wrote:

> OH COME ON you guys!  I was poking fun at Chris' overly obvious statement:
> it doesn't matter in which order you put the terms.

Oh.

(mutters something about the lack of expression in text messages)

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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