POV-Ray : Newsgroups : povray.general : Doc bug - substr() : Re: Doc bug? #range - not a doc bug. Server Time
8 Aug 2024 12:25:10 EDT (-0400)
  Re: Doc bug? #range - not a doc bug.  
From: Thorsten Froehlich
Date: 23 Feb 2001 11:48:02
Message: <3a969442$1@news.povray.org>
In article <3a9690a0@news.povray.org> , Geoff Wedig 
<wed### [at] darwinepbicwruedu>  wrote:

> Except for the slight problem that floats can represent integers

The problem is not that they can't represent integers if rounded at for
example the tenth digit, but if you take the whole floating-point number
you may well have a case like this (the error is just a _very_ simple
example, the real error will be more complicated and may appear in
different operations because of the way floating-point numbers are
represented internally).

Imagine:   integer 4 = floating-point 4.00000000001
           integer 2 = floating-point 2.0000000001

2.00000000001 + 2.00000000001 = 4.00000000002 != 4.00000000001

Get the idea?


      Thorsten


PS: In some cases POV-Ray tries to compensate for this with a little
threshold when comparing for equality.


Post a reply to this message

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