Average Cadence calculation wrong???

On my computer I try to keep a minimum of 100rpm. In fact my highest light gear rpm on the road was 240. But after a ride scroll through the computer and woo average cadence = 80rpm. If I am pedalling in excess of 100 then the average should be in excess of 100.

But wait a minute, when going downhill your cadence in most cases is zero and hence a total number of revolutions are divided by the Ride Time giving an "average cadence".

So my query is should the average cadence be:

1) an element of ride time (Total Pedal Revolutions) divide by Ride Time in Minutes or

2) an element of pedaling time ie when you are not pedalling - cadence calculator time stops.

D**n maths.

If (1) is right, then is once supposed to pedal forever even when circumstances don't apply?