POV-Ray : Newsgroups : povray.general : Large numbers? : Re: Large numbers? Server Time
8 Aug 2024 01:22:23 EDT (-0400)
  Re: Large numbers?  
From: Peter J  Holzer
Date: 31 Mar 2001 17:01:13
Message: <slrn9cchhk.313.hjp-usenet@teal.h.hjp.at>
On 2001-03-30 22:15, Tek <tek### [at] evilsuperbraincom> wrote:
> Xplo Eristotle <inq### [at] unforgettablecom> wrote in message
> news:3AC4B481.CBB3238C@unforgettable.com...
>> What's the largest number POV-Ray can correctly handle (for instance,
>> when specifying translation values or the size of an object)? I
>> always thought the ceiling was in the billions somewhere, but I'm
>> getting unexpected results around ten million or so.. frustrating, to
>> say the least.
>
> As I understand it POV does everything in floating point, which
> means the largest number is ridiculously big (I expect way more than
> billions, 'cause you can do 2 billion in integers).

I think there is no fixed upper (and lower) limit on the numbers you can
use in povray. It depends a lot on what you are doing.

For example, let's say you have 1 point at <1E10, 0, 0> and one at
<1E10, 1, 0>. Both positions can be represented exactly with double
precision floating point numbers, so that's not a problem. Now, let's
assume that Povray needs for some reason to compare their distances
to the origin. 1E20 can be represented exactly in a double, but 1E20+1
cannot and will be rounded to 1E20, so to povray both points will seem
to have exactly the same distance from the origin.

In addition to the inaccuracies inherent in fp computation, povray
sometimes compares against arbitrarily chosen "magic numbers". If your
numbers are much larger or much smaller than the authors of povray
thought anyone would ever need, those comparisons don't yield the
expected results. For example, I once tried to model the solar system
with a pov-unit of 1 km. The sun wasn't visible from the earth.
When I changed the pov-unit to 1 Mm, it magically appeared.

> What it also means is that nothing is ever precise,

This is not true. There are a lot of numbers (approximately 2^64) which
can be represented precicely in a double. Of course, compared to the
infinity of real numbers, that's not much, but it is a lot more than can
can be represented precicely in an integer.

> floating points suffer from a variable accuracy. so the bigger the
> number the bigger the errors.

The conclusion is true, but I'd say this is because the accuracy is
constant, not variable (i.e., it is always about 16 decimal places,
whether you use small or large numbers).

	hp


-- 
   _  | Peter J. Holzer    | Und *da* wurde also die Demokratie




Post a reply to this message

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