[Cfp-interest 2407] Re: x++ and DFP
Mike Cowlishaw
mfc at speleotrove.com
Thu Mar 24 03:41:14 PDT 2022
> C23 says in 6.5.2.4 Postfix increment and decrement operators
> that "1" is added. Joseph Myers has raised the question:
> Which quantum exponent does that "1" have?
>
> For example, should it be 1e0 or 1000000e-6 for 7 digit DFP numbers?
>
> My guess is: the nearest quantum exponent of what 'x' has.
I think that could have some odd effects when 'x' has extreme exponents.
I would/do use 1e0 (that is, '1', as written, not '1.0', '1.00', etc.) and
calculate using the rules for addition or subtraction.
Mike
More information about the Cfp-interest
mailing list