Hi Alexander, On Sat, Jul 19, 2014 at 4:09 PM, Alexander Nasonov <al...@yandex.ru> wrote: > Lourival Pereira Vieira Neto wrote: >> Module Name: src >> Committed By: lneto >> Date: Sat Jul 19 17:11:53 UTC 2014 >> >> Modified Files: >> src/external/mit/lua/dist/src: luaconf.h >> >> Log Message: >> lua(4): preventing division by zero >> >> * note: we should raise an error instead of return INTMAX_MAX > > Userspace lua returns +inf or -inf. So, something like this would > be even better than your change: > > #define luai_numdiv(a,b) \ > ((b) != 0 ? (a)/(b) : (a) > 0 ? INTMAX_MAX : INTMAX_MIN) > > Alex
Did you read the note? How would you represent inf using int types? Regards, -- Lourival Vieira Neto