Re: strange behaviour with luaL_checkinteger()
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: strange behaviour with luaL_checkinteger()
- From: KHMan <keinhong@...>
- Date: 2009年7月04日 22:36:36 +0800
matthias wrote:
I wrote my own Lua-crc function and got some weired results. For
proofing correctness I also implemented a c-program.
But when the c-program returned a negative value (with %d) I got a
different value from the Lua-library.
There is no such thing as a negative number in a CRC calculation.
If you got a negative number displayed, it's in the wrong
representation.
If you have got sample code and test cases to show us, perhaps
someone on the list can point out the specifics.
My algorithm is quite similar to the one from lash-lua:
http://code.google.com/p/lash-lua/source/browse/trunk/crc32.c?spec=svn5&r=5#112
[snip snip]
--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia