C++ Logo


Advanced search

[std-proposals] (Floating Idea) <intdiv> header for integer divisions

From: Jan Schultke <janschultke_at_[hidden]>
Date: Fri, 7 Apr 2023 11:34:10 +0200
 Integer divisions with different rounding modes than the division operator
(truncating rounding) are often useful. In the past, I've either emulated
them with floating point functions or implemented them from scratch each
time, but this is a feature which intuitively belongs in the standard

I've made a rough draft of a proposal here:

The proposal adds 14 functions for obtaining the quotient and remainder of
integer divisions with different rounding modes. There's also a working
implementation for all of them, which still needs more testing but is most
likely correct since I've tested most of it in past projects.

Feedback is highly appreciated, I'm new here :)

Received on 2023-04-07 09:34:22