POV-Ray : Newsgroups : povray.beta-test : Small bug, asking for someone to check on latest RC : Small bug, asking for someone to check on latest RC Server Time
29 Jul 2024 10:20:18 EDT (-0400)
  Small bug, asking for someone to check on latest RC  
From: Slime
Date: 26 May 2002 12:45:23
Message: <3cf11123@news.povray.org>
I discovered this bug, but I'm still using RC3 (since i got home from
college and am back to a modem), so I can't really say "ooh a bug". So I'm
going to throw this out there, because it's really simple, and it'd be cool
if someone with the latest RC could quickly cut and paste this into a new
file and test if it's still there. It's one line, it'll take five seconds if
you're up to it.

The following code:
#debug str(-1^2,5,5)

outputs "1.00000". No negative sign. The negation operator is taking
precedence over the exponent operator. This shouldn't be the case. Note that
the same problem happens with -(1)^2, but not with -(1^2).

Mathematically, if I wrote -1^2, you'd think, "oh, one squared is one, and
then make it negative." But POV-Ray is apparently doing it in the wrong
order, saying "negative one squared is positive one." (-1)^2 works as
expected.

0-1^2 works as it should and outputs -1.00000, with the negative sign. It's
only a problem if the negation is the first part of the expression.

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

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