POV-Ray : Newsgroups : povray.advanced-users : struggle with splines : Re: struggle with splines Server Time
6 Oct 2024 13:05:07 EDT (-0400)
  Re: struggle with splines  
From: Warp
Date: 4 Oct 2006 10:02:35
Message: <4523befa@news.povray.org>
Chris B <c_b### [at] btconnectcomnospam> wrote:
> >          #declare ctr = ctr + 0.01;

> If you specify "#while (ctr <= 1)", then I reckon it should end at P2, 
> rather than one sphere before it gets to P2.

  Only in theory. In practice the last point may still be skipped.
This is because 0.01 cannot be represented in an exact way in binary
floating point format, and adding it repeatedly will cause the error
to grow up so large that the end result will be significantly erroneous.

  (A number like 0.025 *can* be represented with exact accuracy with
binary floating point but 0.01 can't. It might not be immediately obvious
why, if you don't know how binary floating point works, but it's just
like that. It's the same as 1/3 not having an exact representation in
decimal.)

-- 
                                                          - Warp


Post a reply to this message

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