hm, so this is trickier than I thought.  It seems like NaN might actually be the right thing.  Namely, your failover logic for (howMany * distance) below depends on that expression resolving falsey, but you also have divisions by distance elsewhere.  Maybe just do "|| NaN" and explain why that's good?