Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:ClickHouse ClickHouse Extended Types

From Leeroopedia


Knowledge Sources
Domains Numeric_Types, Type_Traits
Last Updated 2026-02-08 00:00 GMT

Overview

Extended integer types and type traits for 128 and 256-bit arithmetic.

Description

Defines Int128/UInt128/Int256/UInt256 using wide integer library, plus custom type traits (is_signed, is_unsigned, is_arithmetic) that work with these types.

Usage

Use for big integer arithmetic, implementing custom numeric types, or working with extended precision calculations.

Code Reference

Source Location

Signature

using Int128 = wide::integer<128, signed>;
using UInt128 = wide::integer<128, unsigned>;
using Int256 = wide::integer<256, signed>;
using UInt256 = wide::integer<256, unsigned>;

template <typename T> struct is_signed;
template <typename T> struct is_unsigned;
template <typename T> struct is_arithmetic;
template <typename T> struct make_unsigned;
template <typename T> struct make_signed;
template <typename T> struct is_big_int;

Import

#include <base/extended_types.h>

Usage Examples

#include <base/extended_types.h>

Int128 big_num = 123456789012345678901234567890_i128;
UInt256 huge = /* ... */;

// Type traits work with extended types
static_assert(is_signed_v<Int128>);
static_assert(is_unsigned_v<UInt256>);
static_assert(is_arithmetic_v<Int128>);

// Make unsigned/signed
using U128 = make_unsigned_t<Int128>;  // UInt128
using I256 = make_signed_t<UInt256>;   // Int256

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment