POV-Ray : Newsgroups : povray.general : Function: Making negative numbers positive : Re: Function: Making negative numbers positive Server Time
11 Jun 2024 10:04:02 EDT (-0400)
  Re: Function: Making negative numbers positive  
From: clipka
Date: 27 Nov 2015 05:45:50
Message: <5658345e$1@news.povray.org>
Am 27.11.2015 um 11:40 schrieb Todd Carnes:

> Why use a function at all? If you want to change a negative number to a
> positive number all you have to do is multiply it by -1.

That's only true if the number in question is known to be negative.

In that case, however, it is easier and more efficient to just use the
unary minus operator:

#declare PositiveNumber = -NegativeNumber;


Post a reply to this message

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