Skip to content

Instantly share code, notes, and snippets.

georgir

Block or report user

Report or block georgir

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View UInt64.js
// Input may exceed JS 53-bit int limits
// So we need a small UInt64 implementation
// Yeah I know it can be improved with some bitwise ops, whatever.
const UInt32Max = 2**32;
export class UInt64{
constructor(hi, lo, rem) {
if (lo !== undefined) {
// Proper overflow/unsignedness of both 32bit components.
if (+lo >= UInt32Max) {
hi += Math.floor(lo / UInt32Max);
You can’t perform that action at this time.