[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: int64 to decimal string conversion
- From: Cosmin Apreutesei <cosmin.apreutesei@...>
- Date: Fri, 8 Oct 2010 03:24:24 +0300
> If you want to avoid external dependencies, you can write your own bignum
> library in lua to deal with numbers 52+52=104 bits wide. Values would be (a
> * 2^52 + b) where a is the top 52 bits and b the bottom ones, so it's just a
> question of math to derive the arithmetic operations ;)
Thanks.
Found this bit here http://lua-users.org/wiki/HammingNumbers (~1000
conversions per second on my machine), maybe I should try optimize the
__mul and __add on that code and just do hi*2^32+lo and be done with
it.