Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
133
rated 0 times [  137] [ 4]  / answers: 1 / hits: 24046  / 10 Years ago, wed, june 4, 2014, 12:00:00

Anyone have any suggestions on how to perform arithmetic on 64bit integers in Node.js? The node-int64 package doesn't seem to support that.


More From » node.js

 Answers
7

Javascript does not support 64 bit integers, because the native number type is a 64-bit double, giving only 53 bits of integer range.



You can create arrays of 32-bit numbers (i.e. Uint32Array) but if there were a 64-bit version of those there'd be no way to copy values from it into standalone variables.



There are some modules around to provide 64bit integer support:





Maybe your problem can be solved using one of those libraries.


[#70732] Tuesday, June 3, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tyemathewj

Total Points: 484
Total Questions: 107
Total Answers: 111

Location: Equatorial Guinea
Member since Sun, Feb 14, 2021
3 Years ago
;