C++ Logo

std-proposals

Advanced search

Re: [std-proposals] D4285R0 Floating-point traits

From: Tiago Freire <tmiguelf_at_[hidden]>
Date: Tue, 23 Jun 2026 21:47:10 +0000
One thing that could be improved is the multiple references to “ISO/IEC 60559:2020” but it doesn’t show up in the reference section of the paper.

Some of the traits I use myself and would recommend you take a look:

Ex. IEE759 float
max_scientific_exponent_10 = 38; - Maximum exponent that a finite number represented in base 10 scientific notation can have
min_scientific_exponent_10 = -45; - Minimum exponent that a finite number represented in base 10 scientific notation can have
max_scientific_decimal_digits_10 = 111; - Maximum number of decimal digits required to represent any finite number in base 10 scientific notation exactly.
max_scientific_precision_10 = max_scientific_decimal_digits_10; - Maximum number of precision digits you can request from a floating-point to text formatting function using base 10 scientific notation.
max_scientific_exponent_digits_10 = 2; - Max number of digits an exponent can have when representing a finite number in base 10 scientific notation
max_fixed_decimal_digits_10 = 149; - Maximum number of decimal digits required to represent any finite number in base 10 fixed point notation exactly
max_fixed_unit_digits_10 = 39; - Maximum number of unit digits required to represent any finite number in base 10 fixed point notation
max_fixed_precision_10 = 149; - Maximum precision digits you can request from a floating-point to text formatting function using base 10 fixed point notation.
min_fixed_precision_10 = -38; - Minimum precision digits you can request from a floating-point to text formatting function using base 10 fixed point notation.
max_shortest_digits_10 = 9; - Number of significant digits required to format any finite floating point number using round-trip shortest notation.

From: Std-Proposals <std-proposals-bounces_at_[hidden]> On Behalf Of Jan Schultke via Std-Proposals
Sent: Tuesday, June 23, 2026 17:49
To: C++ Proposals <std-proposals_at_[hidden]>
Cc: Jan Schultke <janschultke_at_googlemail.com>
Subject: [std-proposals] D4285R0 Floating-point traits

https://isocpp.org/files/papers/D4285R0.html
Hi, I've brought up the idea of having a more powerful replacement for std::numeric_limits a while ago. I've now gotten around to drafting up a paper. Let me know what you think of the direction.
In a nutshell, there is a lot of information that std::numeric_limits doesn't provide, and we cannot fix that because it would break users' specializations. Having more floating-point information would enable users to implement a lot more things portably using the information they get from the standard library.


Jan

Received on 2026-06-23 21:47:17