Infinity output cast to appropriate type