POV-Ray : Newsgroups : povray.newusers : Using a conditional in a function Server Time
1 Nov 2024 16:22:04 EDT (-0400)
  Using a conditional in a function (Message 1 to 2 of 2)  
From: Archpawn
Subject: Using a conditional in a function
Date: 28 Dec 2007 18:50:01
Message: <web.47758b6b1924d6449c37dbc40@news.povray.org>
I made a function that can end up dividing by zero. When a macro divides by
zero, it just generates a warning and moves on. Functions, however, generate
errors, so on the off chance that the divisor is exactly zero, you can't render
the scene. I've tried using both (A?B:C) and select(A,B,C) to make it avoid
division by zero, but both generate an error when used in a function. Is there
any way to use a conditional in a function?


Post a reply to this message

From: Warp
Subject: Re: Using a conditional in a function
Date: 28 Dec 2007 19:33:33
Message: <477595dc@news.povray.org>
Archpawn <nomail@nomail> wrote:
> I made a function that can end up dividing by zero. When a macro divides by
> zero, it just generates a warning and moves on. Functions, however, generate
> errors, so on the off chance that the divisor is exactly zero, you can't render
> the scene. I've tried using both (A?B:C) and select(A,B,C) to make it avoid
> division by zero, but both generate an error when used in a function. Is there
> any way to use a conditional in a function?

  select(). You must have some other error in your function.

-- 
                                                          - Warp


Post a reply to this message

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