CKTIS / C++
std::int64_t — exactly 64-bit signed integer type
std::int64_t from <cstdint> is an alias for a signed integer type with exactly 64 bits and no padding bits. Its availability is optional; do not assume that it always means long long.
Version: C++23; repository compiler flag, production runtime not attested
Syntax
#include <cstdint>
std::int64_t value = 0;std::int64_t, declared in <cstdint>, is an alias for an existing signed integer type, not a new, distinct type. It has exactly 64 bits with no padding bits. Its inclusive range is −9223372036854775808 to 9223372036854775807.
The type is optional: an implementation provides it when it has an integer type of the corresponding width without padding bits. Do not assume that the alias always means long or long long. When at least 64 bits is sufficient, rather than exactly 64, use std::int_least64_t from <cstdint>.
An exact width does not protect calculations from errors. Signed integer arithmetic overflow causes undefined behavior; do not assume that the result wraps around. Choosing std::int64_t also does not widen earlier calculations performed on narrower operands.
The example adds an adjustment to a value beyond the range of a 32-bit signed integer. The LL suffix ensures a long long literal, but does not mean that std::int64_t must alias that type. The supplied source is an evolving working draft, not a frozen C++23 publication.
Examples
#include <cstdint>
#include <iostream>
int main() {
const std::int64_t initial = 3'000'000'000LL;
const std::int64_t adjustment = -25;
const std::int64_t total = initial + adjustment;
std::cout << static_cast<long long>(total) << '\n';
}
Result
2999999975
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.