POV-Ray : Newsgroups : povray.general : Vector comparison : Re: Vector comparison Server Time
29 Jul 2024 04:29:43 EDT (-0400)
  Re: Vector comparison  
From: Kenneth
Date: 30 Dec 2012 01:20:08
Message: <web.50dfdbdb64cb6c10c2d977c20@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:

>
> Caveat: 3D vectors are using floating point arithmetic, strict equality
> is unlikely to occurs due to noise on floating point operations. (e.g. :
> A=<2,4,5>/10; B=<2,4,5>/20; C=B+B+B; D=A+B; ... does D == C ? not sure!)
>

That's something fundamental that I didn't know. But I just always assumed that
POV-Ray took care of the floating-point discrepancy internally (as Warp
indicates), i.e. safely truncating the errors in some way. Put a different way:
I haven't *noticed* any oddities in my scenes.

Using an even simpler case:  something like #if(1/1 = 1) would cause havoc if it
was only 'statistically' TRUE due to floating-point errors. *Hopefully* that's
not the situation! :-O

It raises a question in my mind, though: Given a particular math equation on an
unchanging set of values, are the floating point errors always the same? As in,
frame-by-frame animation?


Post a reply to this message

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