Idiomatic way to avoid divide by zero?
Doing some math, I have a place where I need to divide by a value coming out of a multislider which could emit 0. This is the solution I came up with to avoid spamming the console with error messages. (In this case instead of doing the computation involving the division I can just use the value 0.)
Is this a reasonable way to do it? Or is there something more straight forward? (I've been programming Max for about three days so I have no idea what I'm doing really.)

for a single expr object (and under the circumstance that it is okay for you to output something/else, for example 0.) you could do with with conditions i.e. comparison operators:
expr ( pow(100/$f1, 0.01) ) * ($f1!=0)
because inside the expr, (n/0.) doesnt output NaN or anything, so you can multiply the current status (from the last input!) of (n/0.) with 0 to get 0
this is quite often required for pow/exp/log situations and should work fine.
as alternative you could also write max() or min() of your function and zero, but i dont think that is very clever for pow.
however, it both still prints the error message to the console...
otherwise, if you dont want it to output anything (and avoid the error message to be printed), the second outlet of [route 0.] is your friend.
or [split 0. 0.] when you want to output something.
for the intialisation of patcher arguments (of 0. or missing) i use [if $f1==0. then 16.] to switch "0." (or no argument) to the desired "default" value.
in your case you would probably write [if $f1==0. then out1 0. else out2 $f1]
but [if] is expensive.
-110