POV-Ray : Newsgroups : povray.beta-test : Raising Negative Numbers to a Power : Re: Raising Negative Numbers to a Power Server Time
4 Nov 2024 14:12:36 EST (-0500)
  Re: Raising Negative Numbers to a Power  
From: Josh Seagoe
Date: 1 Oct 2001 23:03:20
Message: <3BB92EF6.6070502@smileyface.com>
ok, MegaPov doesn't work with this either.  I only tested it with a 
calculator before and it worked, but that allows complex numbers.

The SuperTorus still doesn't work as it does in MegaPov tho, and it 
looks like the same problem.  eg:

object {
    SuperTorus(1,.4,1.4,1.4,0,2)
    pigment { rgb 1 }
}

MegaPov gives the mathimatically correct result, while POV 3.5 beta 4 
gives the result you'd expect with rounding errors on the exponents.

To get (almost) the same results out of POv 3.5, you have to change the 
function to:
function { (abs((abs(x)^RP + abs(z)^RP)^(1/RP) - RMj)^CP + 
abs(y)^CP)^(1/CP) - RMn}

-josh


Mark Wagner wrote:

> 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.