--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html
为啥抛出这个错误?luajit -e 'local bit = require "bit" print(bit.lshift(0xffffffffffLL, 1))'luajit: (command line):1: bad argument #1 to 'lshift' (number expected, got cdata)stack traceback:[C]: in function 'lshift'(command line):1: in main chunk[C]: at 0x0100002150
在 2016年6月22日星期三 UTC+8下午1:32:48,agentzh写道:Hello!
On Wed, Jun 8, 2016 at 3:14 AM, codingforfan wrote:
> 看到luajit2.1已经支持64bit位运算了,然后升级了下luajit,貌似并不管用呢,求解?
>
> http://luajit.org/sponsors.html#sponsorship_bit64
>
> 或者有其他方法来支持64bit的位运算么?
>
可以。通过 int64_t 或者 uint64_t 类型的 FFI cdata 类型。比如:
$ luajit -e 'local bit = require "bit" print(bit.lshift(0xffffffffffLL, 1))'
2199023255550LL
Regards,
-agentzh
--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html