POV-Ray : Newsgroups : povray.general : Even/odd check? Server Time
7 Aug 2024 11:24:56 EDT (-0400)
  Even/odd check? (Message 1 to 4 of 4)  
From: Mahalis
Subject: Even/odd check?
Date: 7 Oct 2001 15:47:55
Message: <3bc0b16b$1@news.povray.org>
How would you test whether a number was even or odd in POV 3.1?


Post a reply to this message

From: Rune
Subject: Re: Even/odd check?
Date: 7 Oct 2001 16:18:57
Message: <3bc0b8b1@news.povray.org>
"Mahalis" wrote:
> How would you test whether a number
> was even or odd in POV 3.1?

(N/2=int(N/2))

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated June 26)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

From: Mahalis
Subject: Re: Even/odd check?
Date: 7 Oct 2001 18:29:53
Message: <3bc0d761$1@news.povray.org>
Yes!! Thank you!

"Rune" <run### [at] mobilixnetdk> wrote in message
news:3bc0b8b1@news.povray.org...
> "Mahalis" wrote:
> > How would you test whether a number
> > was even or odd in POV 3.1?
>
> (N/2=int(N/2))
>
> Rune
> --
> 3D images and anims, include files, tutorials and more:
> Rune's World:    http://rsj.mobilixnet.dk (updated June 26)
> POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
> POV-Ray Webring: http://webring.povray.co.uk
>
>


Post a reply to this message

From: Anders K 
Subject: Re: Even/odd check?
Date: 7 Oct 2001 19:29:45
Message: <3bc0e569$1@news.povray.org>
> > How would you test whether a number
> > was even or odd in POV 3.1?
>
> (N/2=int(N/2))

That looks slow... What about (mod(N, 2) = 0)?

Anders


Post a reply to this message

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