POV-Ray : Newsgroups : povray.general : Domain error in pow : Re: Domain error in pow Server Time
10 Aug 2024 15:15:06 EDT (-0400)
  Re: Domain error in pow  
From: Alf Peake
Date: 4 Dec 1999 06:13:49
Message: <3848f76d@news.povray.org>
Thanks Chris, as you guessed it was a shortcut to save an assignment because
I seem to end up with too many #declares and us over-60s get easily confused
:-)
Many thanks again

Alf

Chris Colefax <cco### [at] geocitiescom> wrote in message
news:3845e24a@news.povray.org...
> Alf Peake wrote:
> > /* Re my earlier post _Pinching points_ and responses by Chris Colefax
> and
> > Bill DeWitt:
> > I get a non-fatal "Domain error in pow" each pass through the loop
> below if
> > in pow(A,B) B is not an integer and I use the D2 section. Both
> sections
> > should be the same and do evaluate the same. Is there a mistake in my
> script
> > that I'm missing? The docs say pow(float,float).
>
> to which Jerome M. BERGER <jbe### [at] enstfr> replied:
> > Yes but if the second number is not an integer, the first one must be
> > greater than 0...
> > The way I see it:
> > * in the first example, PoV only evaluates the right #declare and the
> > test ensures that the value is correct;
> > * in the second example, PoV evaluates both values (or tries to) and
> > then chooses according to the result of the test, which generates an
> > error since one of the values is incorrect...
>
> This is precisely the case, and so it would be correct (indeed,
> necessary) to use the full #if () #declare ... #else #declare ... #end
> syntax if you wanted to use non-integer powers (but I guess some of us
> just can't resist a shortcut!).
>
>


Post a reply to this message

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