Download Latest Version lualubit.zip (193.6 kB)
Email in envelope

Get an email when there's a new version of lualubit

Home
Name Modified Size InfoDownloads / Week
release_5.2 2012-01-09
beta_5.2 2012-01-07
lualubit.zip 2012-01-09 193.6 kB
readme.txt 2012-01-09 1.6 kB
lubit_expl.lua 2012-01-09 11.6 kB
test_speed.txt 2011-11-03 21.2 kB
testcalc.lua 2011-11-03 11.8 kB
testlubit.lua 2011-11-03 1.4 kB
Totals: 8 Items   241.2 kB 0
0:06 2012-01-08
Rework of lualubit for release Lua 5.2 source code
created directories
	beta_5.2
	release_5.2
added test/explanation file lubit_expl.lua
added homepage www.sbmintegral.sk/lua

13:04 2011-11-02

In newest Lua 5.2 beta is implemented UNSIGNED INTEGER type and library bit32 for bitwise operations.
BEAUTIFULL !

But I don't like write
	a = bit32.bor(bit32.band(5,2345),bit32.band(23,7))
instead of
	a = 5&2345|23&7
that's why I rework source codes ( lua-5.2.0-beta.tar.gz [NEW] 	2011-07-08 
								http://www.lua.org/work/lua-5.2.0-beta.tar.gz )
to use "native" operators (based on http://www.wra1th.plus.com/lua/risclua.html source code) :
	band    &
	bor     |
	bxor    ^^
	lshift  <<
	rshift  >>
	bnot    ~
and additional logical operators :
	land     &&
	lor      ||
	lnot     !
	

All source code changes are dependent on (luaconfig.h) 
#define GCW_BIT
/*
GCW_BIT: Use bit library.
This extends virtual machine with bitwise operations
&,|, ^^, ~, <<, >> and provides corresponding events.
Warning! Makes code non-portable.
Affects c.lvm, c.lcode, c.lopcodes, c.ltm
c.llex, c.lparser, h.lcode, h.lopcodes
h.ltm, h.llex, h.luaconf.
 
additionally NUM_logical operators ( return numerical (1,0), not boolean values )
!,&&,||
*/

IMPORTANT:   in standart Lua is not possible use boolean (true,false) in arithmetical operations,
but I need it. 
On (lvm.c line:375) is it possible (unremark) allow using booleans only for new operators.
------------------------------
Need tests, if all is correct.
------------------------------



Source: readme.txt, updated 2012-01-09