[cfp-interest 3527] Re: Rounding Direction Mode or Rounding Direction or Rounding Mode

Damian McGuckin damianm at esi.com.au
Tue Jun 10 22:50:21 PDT 2025


On Tue, 10 Jun 2025, Jerome Coonen wrote:

> Damian, my intention is to stick with current C usage, retro flavor and
> all, in which "rounding mode" implies the mode related to rounding
> direction. This is laid out in 5.3.5.3.3 today. There is no need to
> introduce "rounding direction mode" and then never use it again.

I agree.  I do not understand why it should ever appear.

As you note, the term "rounding mode" is defined on p26 in 4.3.5.3.3#23. 
It mentions the values it can take, being (-1) for indeterminable and 0 
through 4 otherwise. I note that the term appeared early on p5 in the 
Glossary.  I am totally on board with "rounding mode".

But ...

The term "rounding direction" appears p63 and appears about 200 times (47 
of which are in the term "round direction mode"). In the context of 
translation time, "rounding direction" is defined on p63 as "either the 
default or a constant rounding mode set by an FENV_ROUND or FENV_DEC_ROUND 
pragma". I think the word direction there is perfectly clear and correct 
here. It is one of those "rounding modes" of p26.

As far as I can tell, the term "rounding direction", but without the word 
mode following it, means the currently active rounding mode. Well mostly. 
It is sometimes used loosely.

The term "rounding direction mode" first appears on p156 and is not 
defined but is still used a further 46 times.

7.6.1#13 seems to infer that

 	FE_DOWNWARD
 	FE_TONEAREST
 	FE_FENEARESTFROMZERO
 	FE_TOWARDZERO
 	FE_UPWARD

are the base set of "rounding directions". It says that "Additional 
implementation-defined rounding directions, with macro definitions 
beginning with FE_ and an uppercase letter, may also be specified by 
the implementation.  On p26, such "rounding directions" were called
rounding modes.

Worse still, a few pages later, 7.6.6 says that

 	fegetround() and fesetround()

provide control of rounding direction modes. just a little while ago, it 
said these get and set rounding direction.

I noticed that 7.6.1#8 talks about "the dynamic rounding direction mode". 
Isn't there only "the dynamic rounding direction" which can be one of 
several "rounding modes". Unless you want to nominate those "rounding 
modes which can be selected dynamically" to be "dynamic rounding direction 
modes" but that is a stretch and even then, it would demand that the word 
mode in that paragraph be plural. (Some hardware supports setting less 
than the full set of rounding modes dynamically).

As far as I can tell, the use of "rounding direction mode" is odd. It 
means "rounding direction" in some places and "rounding mode" elsewhere.
But maybe I am very confused.

I want to use to the right term in Annex F and Annex G. There is already 
enough inconsistency between those two Annexes in other areas to keep me 
busy. I do not need more.

Thanks - Damian


More information about the cfp-interest mailing list