> What is the smallest number that I can realistically use for a variable value?
> Largest?
>
> (Maybe yuqk can have yuqk_smallest and yuqk_largest as internal values to
> compare against?)
The fine print first (Disclaimers)
----------------------------------
The safe answer is I don't know for the code you with which you are working.
It depends on the maths involved. If using the calculated results in
downstream (or from upstream) POV-Ray functionality, it sometimes depends on
what that functionality is.
The math within parser's Scene Description Language (SDL) is different than
the where shapes, functions and ray tracing are involved.
The yuqk fork is different numerically than is the official POV-Ray code base.
For one, it much more often uses double as the pass around, working float
representation. Yuqk uses two 'epsilon' values internally where the POV-Ray code
base uses one, more generic 'epsilon' value.
Floating point math can be a wild ride no matter POV-Ray / yuqk fork
specifics.
Guidelines
----------
When working within the Scene Description Language (SDL)
--------------------------------------------------------
The SDL identifiers / variables are at double accuracy for single values and
vector values of sizes 2 through 4. The 5D vector is always a color vector at
float accuracy. Language constants like 'pi' are at double accuracy.
Where values are passed through POV-Ray's internal messaging system, doubles
are cast to floats in official releases of POV-Ray. The yuqk fork maintains
the double representation.
Small value
-----------
Where you need a small value in official releases of POV-Ray sticking with
the 1e-10 value recommended by:
https://wiki.povray.org/content/Reference:Numeric_Expressions
is a good rule of thumb. This is the single EPSILON value the official source
code uses internally.
With the yuqk fork there are two small values internally. One for testing
for effective zero values or effective equivalent values called gkDBL_epsilon.
Another larger value is used where one might be using solvers, or heavier
math functions like sqrt(), it is called gkMinIsectDepthReturned.
Currently these are set to:
gkDBL_epsilon = 4.44089e-16
gkMinIsectDepthReturned = 4.44089e-08
Examples:
#if (abs(A-B)