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