Perhaps you need a IsInfinite() function to solve this.