fix failure to read infinity in scanf