|
|
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
|
|