POV-Ray : Newsgroups : povray.general : 32.32 fixed float math? : Re: 32.32 fixed float math? Server Time
1 Aug 2024 18:29:01 EDT (-0400)
  Re: 32.32 fixed float math?  
From: Warp
Date: 2 Jul 2005 12:37:56
Message: <42c6c2e4@news.povray.org>
Raf256 <spa### [at] raf256cominvalid> wrote:
> All basic math on them can be done as on 64 bit integers AFAIR, and  they
> offer size of about -2,000,000,000 .. +2,000,000,000 with precision of 
> .0000000004 with seems realy enought for PovRay needs (anyway using in scene
> values below 0.0001 and in some conditions even below 0.001 leed to some
> distortions).

  Take into account that calculations may temporarily get values which
are much higher (or smaller) than the dimensions of the scene.

  One simple example: Calculating the distance between two points is
done with sqrt(x*x+y*y+z*z) where <x,y,z> is the vector between the
two points. You can easily see from that formula that it temporarly
gets values very much larger than x, y or z alone.

  Floating point math is quite ideal for this because it works just
perfectly for these kinds of calculations.

-- 

                                                          - Warp


Post a reply to this message

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