NaN's and infs

Would somebody kindly direct me to some information on how to deal with
dividing by zero? I am getting ValueError: math domain error, is there
anything I can do to return an inf instead?

Thanks,

Darren