Division by Zero Error

Mike Bonner bonnmike at gmail.com
Sat Jul 8 08:44:04 EDT 2017


I use the try/catch/finally method mark mentions if there is a chance of
divide by 0 errors.  That way, no need to predict, just try it, and if
theres an error, respond accordingly.

On Sat, Jul 8, 2017 at 1:08 AM, hh via use-livecode <
use-livecode at lists.runrev.com> wrote:

> -- d0 is what you judge as "is at about zero" for your input
> -- select it such in size, that you don't get an "overflow" or
> -- such that 1/d0 is your max ± vertical plot value (= clipping)
>
> function f3 x
>    local d0=0.001
>    if abs(x-3) < d0 then
>       return empty -- don't plot in case of an empty return
>    else return 1/(x-3)
> end f3
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list