lua-users home
lua-l archive

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


On Thursday 09 December 2004 16:41, John Paquin wrote:
> So the question I'm asking is, how hard would it be to make a seperate
> "int" data type?

basically creating new numeric types like complex, vectors,
fixed point or arbitrary precision bigints as userdata with
metatabled operator overloading is quite straightforward
-- at the price of some performance penalty, obviously.

Probably you'd choose int as builtin and make all others
nice "classes" (with all the math becoming methods of double).
That way you would be able to choose you number type for
the real calculations by pluging the appropriate lib, err, class.

At least that's the way I am going to do it ...