POV-Ray : Newsgroups : povray.off-topic : Unexpected : Re: Unexpected Server Time
28 Jul 2024 22:24:15 EDT (-0400)
  Re: Unexpected  
From: Orchid Win7 v1
Date: 18 Aug 2013 10:44:35
Message: <5210ddd3$1@news.povray.org>
>>>> But you can phrase that as
>>>
>>>>      return x ? x : -x;
>>>
>>> No, you can't.
>>>
>>> Don't blame others for doing mistakes if you are doing them yourself. ;)
>
>> The guy took about 6 minutes to come up with the answer illustrated. My
>> problem was in only spending 6 seconds. :-/
>
> The problem is that the answer above doesn't work.

Yes, because I typed it too fast. What I meant to say was

   return (x >= 0) ? x : -x;

which works as expected.


Post a reply to this message

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