POV-Ray : Newsgroups : povray.advanced-users : Numerical Precision : Re: Numerical Precision Server Time
4 Oct 2024 17:07:08 EDT (-0400)
  Re: Numerical Precision  
From: Warp
Date: 9 Sep 2007 14:52:38
Message: <46e440f6@news.povray.org>
Woody <nomail@nomail> wrote:
> If POV-Ray does not store numbers as text, then why if I use the command

> #debug str(pi,1,50) is the output followed by so many 0s?

  What makes you think that printing dozens of characters '0' requires for
POV-Ray to store the number in memory as a string?

  What you are telling to str() is to print 50 decimals, and it does that:
It prints 50 decimals. The implementation of the C library function which
str() calls has a loop which prints as many decimals as you tell it to.
You can tell it to print 10000 decimals and it probably will do that.
  That doesn't mean that the other number is stored with 10000 decimals.
The function simply keeps printing decimals until the actual number has
no more data left, after which everything that is left to print is nothing.
Since printing zeros after the decimal point is equivalent to nothing, that's
exactly what the function does because you asked it to print so many decimals.

-- 
                                                          - Warp


Post a reply to this message

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