POV-Ray : Newsgroups : povray.general : Domain error in pow : Domain error in pow Server Time
10 Aug 2024 15:20:19 EDT (-0400)
  Domain error in pow  
From: Alf Peake
Date: 1 Dec 1999 17:28:43
Message: <3845a11b@news.povray.org>
/* 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).
I'm using 3.1d.msdos.wat-cwa and Win98SE. */

// Start - no camera or light needed in dos version.
sphere{0,1 pigment{ rgb 1 } hollow} // Removes no object error.
#declare N=1;
#while (N>0)

//   This is OK
#if (N<0.75) #declare D1 = (1 - pow(1-(N/0.75), 1.5)) * 0.75;
   #else     #declare D1 = pow((N-0.75)/0.25, 1.5) * 0.25 + 0.75;
#end

//   This gives domain error in pow
#declare D2 = ( (N<0.75)
   ? (1 - pow(1-(N/0.75), 1.5)) * 0.75
   : pow((N-0.75)/0.25, 1.5) * 0.25 + 0.75 );

   #declare N=N-0.1;
#end
// e.o.file


Alf

http://www.peake42.freeserve.co.uk
http://ourworld.compuserve.com/homepages/Alf_Peake/


Post a reply to this message

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