I would like an example on how to catch all division by zeros in Fortran. My idea is the following in pseudo-code: num, denom = catch_div_byzero() return bignumber (and not nan) Is this even possible? In other words, I would like to alter division by zero so that it returns a huge number. can it be made even in C and then linked as library to my fortran code?