POV-Ray : Newsgroups : povray.beta-test : Raising Negative Numbers to a Power : Re: Raising Negative Numbers to a Power Server Time
30 Jul 2024 20:28:04 EDT (-0400)
  Re: Raising Negative Numbers to a Power  
From: Mark Wagner
Date: 1 Oct 2001 22:07:19
Message: <3bb92157@news.povray.org>
Josh Seagoe wrote in message <3BB### [at] smileyfacecom>...
>Ok, more specific about what I posted about SuperTorus...
>
>This:
>#declare K=function(v,p) { (v^p)^(1/p) }
>
>#debug concat(str(K(1,3), 2, 4), "\n")
>#debug concat(str(K(.1,3), 2, 4), "\n")
>#debug concat(str(K(-1,3), 2, 4), "\n")
>#debug concat(str(K(-.1,3), 2, 4), "\n")


Computers can't do exact representations of many fractions, so instead of
trying to guess whether 0.33333333 is supposed to represent 1/3 or not, most
computers simply reject the notion of raising negative numbers to
non-integer powers.

Try using the Windows calculator program to evaluate these.  It's not a
shortcoming in POV-Ray, it's a shortcoming of almost every computer in the
world.

--
Mark


Post a reply to this message

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