POV-Ray : Newsgroups : povray.advanced-users : Max-value with function int() : Re: Max-value with function int() Server Time
29 Jul 2024 06:13:42 EDT (-0400)
  Re: Max-value with function int()  
From: Will W
Date: 14 May 2003 19:46:03
Message: <3ec2d53b@news.povray.org>
"Thorsten Froehlich" <tho### [at] trfde> wrote in message
news:3ec2a952@news.povray.org...
> In article <3ec25305@news.povray.org> , "Will W"
<wil### [at] NOSPAMwizzardsnet>
> wrote:
>
> > So, this demonstrates this implementation of POV represents integers
with a
> > 32 bit number wheel, that wraps from positive to negative values at 2
raised
> > to the 31st power (2^31, 2**31, or pow(2,31). This is of course because
the
> > high order bit is used as a sign bit.
>
> Nobody ever said POV-Ray offers infinite precision.  To the contrary, it
has
> been said very often that very small or very big numbers when used will
not
> always produce the desired results.
>
>     Thorsten
>

I feel like you've missed my main point and focused on a minor explanatory
detail.

I don't see where there is anything wrong with the POV implementation of
int( ). The limitations of integer arithmetic are well known; the SDL's
limitations in this regard are no different from most C and C++ compilers,
and derivative works.

With one exception.

Generally in other packages the limitations of int( ) function are
documented. This is missing from POV's documentation. An additional sentence
that stated the range of integers would bring POV's int( ) function into
alignment with similar packages, and help savvy SDL writers avoid problems
in their code.

A broad statement that very "very big or very small numbers when used will
not always produce the desired results" implies, to me, that there are the
usual problems with very large or very small floats, like around pow(10,80)
and pow(10,-80).  Two billion and change just isn't all that big-- and is an
entirely different kind of accuracy problem.

I'm not saying you've got an ugly baby or it needs corrective surgery. It's
a bright, happy baby, and a lot of fun. But there is a button undone on her
documentation.


--
Will Woodhull
Thornhenge, SW Oregon, USA
willl.at.thornhenge.net


Post a reply to this message

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