C++ Logo

std-proposals

Advanced search

[std-proposals] Single and multiple precision types

From: Lev Minkovsky <levmink_at_[hidden]>
Date: Wed, 26 Nov 2025 23:14:20 +0000
Hello all,

                 Thank you for your active participation in the discussion about extended precision types.

                 There is a better way to accomplish what I am looking for. Virtually every hardware architecture provides some support for double precision math. For example, 32-bit platforms can effectively and directly do 64-bit operations, and 64-bit platforms - 128-bit operations. A good deal of that support is already available in existing C++ implementations.

                 We now have the following set of integral types:


  1. size-constrained fundamental types (e.g., long long is at least 64 bit).
  2. fixed-size library types, aliasing to fundamental types (e.g., int16_t)
  3. the potential future wide gamut of bit-precise types (e.g., _BitInt(48)).

In addition to those, we can introduce the following word-length-dependent types:

_Single. unsigned _Single
                 _Mult2, unsigned _Mult2.

The _Single types will be aliases of some C++26 fundamental types. For example, on x64, _Single can be aliased to long long. The _Mult2 types on 32-bit platforms can aliased to (unsigned) long long, and on 64-bit platforms introduce standard 128-bit integer types.

If we want to, we can also have the respective literals. For example,

                  auto x = 1sl;
                  auto y = 1m2;

Here, x will be a single precision integer, and y - double precision integer, both equal to 1.

All this should be easy to implement with native-level performance, and therefore we should expect quick and wide adoption.

Please let me know if you think this is proposal worthy.

Best regards -

                 Lev Minkovsky

Received on 2025-11-26 23:14:24