Skip to content

Instantly share code, notes, and snippets.

View bean-mhm's full-sized avatar

Bean (Hadi Farid) bean-mhm

View GitHub Profile
@bean-mhm
bean-mhm / int128.h
Last active January 10, 2024 06:23 — forked from kimwalisch/int128.h
A signed 128-bit integer type. Internally stores its data in Two's Complement within two unsigned 64-bit integer parts. Still needs more testing, but basic implementation is fairly complete.
// Original:
// https://gist.github.com/kimwalisch/c8c40c5505d1b2e2c9389b09ae48f306
// Fork:
// https://gist.github.com/bean-mhm/ff249cc45ed179b4ed59b9e1afd363f4
#pragma once
#include <cassert>
#include <cstdint>