lua-users home
lua-l archive

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


Hi,

I posted an idea on how values could be represented to improve
performance for doubles.

http://lua-users.org/lists/lua-l/2015-03/msg00141.html

I think that this scheme can be extended to allow complex numbers to
be represented.
So for complex numbers:

first 8 bytes could be a double representing the real part
second 8 bytes could be a double representing the imaginary part

If a value is a not a complex number then the real part will either be
NaN, or if the real part is a double then the imaginary part will be a
NaN.

I am assuming that NaN tagging approach is considered non-portable /
not ISO C for Lua?

Regards
Dibyendu