"inf" is double datatype value (http://en.wikipedia.org/wiki/IEEE_754-1985#Representation_of_non-numbers) There is no integer "inf" value, so lua_isnumber() rejects "inf" as it is NOT an integer.