Comments (8)
Actually, you don't need to use the ffi function directly. LuaJIT does the boxing/unboxing automatically. Just need to tell it's a long number by appending the "ll" modifer.
a=9223372036854775807ll
b=9223372036854775806ll
=a-b
1LL
from luajit2.
how to increase size to 32 simbols?
from luajit2.
hello? creators ? little bird needs you
from luajit2.
Maybe use BigNum library? Like this one https://github.com/user-none/lua-nums ?
Really strange to post textual question using image. Distasteful.
from luajit2.
You can use ffi to workaround big integer issue. It should be easier than using a big number library.
ffi=require'ffi'
a=ffi.new('uint64_t', 9223372036854775807ull)
=a
9223372036854775807ULL
b=ffi.new('uint64_t', 9223372036854775806ull)
=b
9223372036854775806ULL
c=a-b
=c
1ULL
d=c
=d
1ULL
=tonumber(d)
1
from luajit2.
Actually, you don't need to use the ffi function directly. LuaJIT does the boxing/unboxing automatically. Just need to tell it's a long number by appending the "ll" modifer.
a=9223372036854775807ll
b=9223372036854775806ll
=a-b
1LL
no, this way is not good,i just want to use int64 without ll, and can use tostring,can u tell me how to compile luajit for int64 ?
from luajit2.
i just want to use int64 without ll
Unfortunately, you cannot do that. Lua can only store 64-bit integers up to 2^53. With LuaJIT, it automatically boxes 64-bit values in CDATA object when it detects the "ll" or "ull" modifiers.
can u tell me how to compile luajit for int64 ?
Don't understand your question. There is no special compile options for int64. Just use the standard source code and compile for your platform.
from luajit2.
i just want to use int64 without ll
Unfortunately, you cannot do that. Lua can only store 64-bit integers up to 2^53. With LuaJIT, it automatically boxes 64-bit values in CDATA object when it detects the "ll" or "ull" modifiers.
can u tell me how to compile luajit for int64 ?
Don't understand your question. There is no special compile options for int64. Just use the standard source code and compile for your platform.
omg,i don't want to use C# to wrapper my API...
can luajit2's developer can do it ?
from luajit2.
Related Issues (20)
- unexpected index -1 comes up when copy a table with only one element HOT 9
- hash_128_above can only cover half string for hash compute HOT 1
- Failed to start The OpenResty Application Platform. HOT 1
- fails to build for iOS simulator
- Versioning info confusion.
- error: “bad light userdata pointer” On AArch64 when Enable Memory Tagging Extension feature
- arm64 luajit loop cpu nearly 100% in lua_resume function,same code run in x86 is ok HOT 3
- 编译后静态库体积大 HOT 2
- please, when will the latest luajit repository be merged?
- openresty CPU single core 100% ( profiling luajit table rehash) HOT 1
- lj_ccall.c:1192:5: error: use of undeclared identifier 'CCALL_MAXSTACK'
- nogc bggc feature for luajit2 HOT 1
- ppc64le support HOT 4
- cmake support HOT 1
- Can OpenResty1. 25.3.1 support compilation and installation of LoongArch? HOT 1
- Shared dictionary cannot retrieve stale data HOT 4
- luajit default allocator does not respect alignment requirements in all cases HOT 1
- luajit vs luajit2 HOT 2
- Cmake support like tarantools and github action for auto testing?
- How do I use the tests in the t directory?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luajit2.