Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我发现这0xFFFFFFFFFFFFFFFF不在18446744073709551615Nclojure-1中。(unchecked-long 0xFFFFFFFFFFFFFFFF)有效,但会产生运行时成本。
0xFFFFFFFFFFFFFFFF
18446744073709551615N
-1
(unchecked-long 0xFFFFFFFFFFFFFFFF)
还有什么办法吗?
我建议只使用unchecked-long.
unchecked-long
运行时开销可能为零,因为 JIT 编译器应该足够聪明,可以将其优化为恒定负载。
您可以在读取时计算该值,以防止它成为运行时成本:
#=(unchecked-long 0xFFFFFFFFFFFFFFFF)