POV 3.5 beta 12
I'm surprized that odd doesn't work properly. I have posted my version of
even/odd pair into
http://news.povray.org/p4hv5ugh4prqd2s2fr7nu0o9vabih5k741%404ax.com month ago
and it works properly for _any_ float not only integers.
My version produces following test output:
1 isn't even.
1 is odd.
1.500000 isn't even.
1.500000 isn't odd.
2 is even.
2 isn't odd.
while version attached to beta 12 produces:
1 isn't even.
1 is odd.
1.500000 isn't even.
1.500000 is odd.
2 is even.
2 isn't odd.
Perhaps I wrongly understand term "odd" but if not I suggest to fix this
behaviour for _any_ float with definition:
#local odd=function(N){even(N+1)};
ABX
From: Christoph Hormann
Subject: Re: [std include] wrong odd() behaviour
Date: 5 Mar 2002 05:18:01
Message: <3C849B34.B303B763@gmx.de>
> > POV 3.5 beta 12> > I'm surprized that odd doesn't work properly. I have posted my version of> even/odd pair into> http://news.povray.org/p4hv5ugh4prqd2s2fr7nu0o9vabih5k741%404ax.com month ago> and it works properly for _any_ float not only integers.> > [...]
The different implementation was chosen for speed reason, i'm not sure
what would be the mathematically correct behavior, if yours is better the
'even(N+1)' version for 'odd()' is probably not that much slower.
Christoph
--
POV-Ray tutorials, IsoWood include,
TransSkin and more: http://www.tu-bs.de/~y0013390/
Last updated 21 Feb. 2002 _____./\/^>_*_<^\/\.______
On Tue, 05 Mar 2002 11:17:24 +0100, Christoph Hormann <chr### [at] gmxde>
wrote:
> if yours is better
if not, then at least documentation should be updated to precise integer type
of parameter
ABX
1.5 is neither even nor odd. Only integer numbers can be "even" or "odd".
--
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/
On Tue, 05 Mar 2002 09:40:56 -0500, Christopher James Huff <chr### [at] maccom>
wrote:
> 1.5 is neither even nor odd. Only integer numbers can be "even" or "odd".
That's what I pointed.
ABX