lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> [...] Why not instead have integers return 'int' for the core function
> type?

One, because that would be a huge incompatibility. Second, because more
often than not it does not matter whether a number is an integer or a
float. In general, they have exactly the same behavior. And even when
the behavior differ (basically overflows), programmers will want to
impose a specific behavior (forcing a number to be a float or an int),
not to know which behavior will happen (checking whether a number is
a float or an int).

-- Roberto