POV-Ray : Newsgroups : povray.advanced-users : Square roots of negative numbers in isosurfaces? : Re: Square roots of negative numbers in isosurfaces? Server Time
30 Jul 2024 12:28:15 EDT (-0400)
  Re: Square roots of negative numbers in isosurfaces?  
From: Ron Parker
Date: 17 Jan 2000 16:32:09
Message: <38838a59@news.povray.org>
On Mon, 17 Jan 2000 16:17:16 -0500, Greg M. Johnson wrote:

>Again, I hound this point not to attack the giants whose shoulder we stand on--pov
>developers--but to have fun at solving a mathematical mystery : what IS pov doing?


void func_exp_xy(void)
 {
  if (((*calc_stack_top)>0) && ((*calc_stack_top)<16) &&
      (FFLOOR(*calc_stack_top)== *calc_stack_top))
   {
    fint= *(calc_stack_top--);
    ftemp1= (*calc_stack_top);
    for (; fint>1; fint--) (*calc_stack_top)*= ftemp1;
   }
  else
   {
    calc_stack_top--;
    *(calc_stack_top)= pow( *(calc_stack_top),*(calc_stack_top+1));
   }
 }

translated:

in the equation x^y,
if y is an integer between 1 and 15 inclusive
  calculate x^y by multiplying x by itself y times.
otherwise,
  call the C function pow(x,y) and return its result
  directly.


Presumably, pow(x,y) itself does something when presented
with invalid parameters, but what that is isn't specified
in the MSVC documentation.  It may be specified in the ANSI
C spec; I haven't checked.

-- 
These are my opinions.  I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

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