POV-Ray : Newsgroups : povray.newusers : rounding : Re: rounding Server Time
28 Jul 2024 22:32:19 EDT (-0400)
  Re: rounding  
From: Jan Dvorak
Date: 26 Jun 2008 08:14:01
Message: <48638809$1@news.povray.org>
Chris B napsal(a):
> "Warp" <war### [at] tagpovrayorg> wrote in message 
> news:48635c1a@news.povray.org...
>> Chris B <nom### [at] nomailcom> wrote:
>>> But a result which is not necessarily the same each time you calculate 
>>> the
>>> answer using the same dataset as input.
>>  You should never rely on getting an exact result when calculating with
>> floating point numbers anyways.
>>
> 
> No, but, a computer that doesn't give the same results when you run an 
> algorithm twice in a row would be hell to debug. So you'd expect 'if 
> (1/3=1/3)' to always give the same answer, not true half the time and false 
> the other half.
> 
> Regards,
> Chris B. 
> 
> 
I've got another idea: force the LSB to 1. If it was 0 the result is 
rounded up. If it was 1 the result is rounded down.
This emulates the randomness in a deterministic way.

-- 
You know you've been raytracing too long when...
you start thinking up your own "You know you've been raytracing too long 
when..." sigs (I did).
		-Johnny D
Johnny D


Post a reply to this message

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