POV-Ray : Newsgroups : povray.off-topic : An interesting read : Re: An interesting read Server Time
28 Jul 2024 20:32:12 EDT (-0400)
  Re: An interesting read  
From: Orchid Win7 v1
Date: 13 Jan 2014 17:03:51
Message: <52d462c7@news.povray.org>
On 13/01/2014 09:36 PM, Francois Labreque wrote:
> Le 2014-01-12 05:38, Orchid Win7 v1 a écrit :
>>
>> I don't have the book in front of me now, but prime number sieving is
>> actually one of the examples. They even go so far as to remove the "stop
>> searching after sqrt(max)" optimisation to "make the code simpler".
>> Because most of the time, being able to understand the code is far more
>> important than getting maximum performance out of it.
>
> If you do leave it in, *that* is worthy of a comment. Not every
> programmer will be good enough with math to figure out why you don't
> need to check for factors > sqrt(max).

I agree. That's the sort of thing that's sufficiently non-obvious that 
it ought to be explained somewhere.

Then again, how many programs sieve prime numbers? Most software seems 
to just push database records from A to B and back again...


Post a reply to this message

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