test for infinite values to prevent endless while loops in number value printing