[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
motion for Aug: make nextAfter homogeneous
Dan, I'd like to make the following motion at the August meeting.
-Jim
-----------------
Motion: make nextAfter homogeneous
Rationale:
The current draft in 7.4.1 classifies nextAfter as semi-homogeneous:
-- source1Format nextAfter(source1, source2)
but does not actually say which formats must be supported for source2.
A natural interpretation might be that all formats must be supported,
which would make the interface unnecessarily large and confusing. This
proposal makes nextAfter homogenous, which reduces the possible formats
for source2 to just the format of source1.
The proposed version of nextAfter is limited in that extra precision in
the computation of the direction (second operand) might be lost in
conversion to the format of the operation. C99 addresses this by
providing not only a homogeneous nextafter function but also a
(semi-homogeneous) nexttorward function whose direction parameter is
long double regardless of the format for the other argument and result.
I don't think this extra operation is necessary for 754R because the
nextUp and nextDown functions provide its essential functionality: if
(x >= expr) then nextx = nextUp(x); else nextx = nextDown(x);, where the
condition x >= expr will not lose precision in either operand.
Text change:
Move the definition of nextAfter from 7.4.1 to 7.3.1, changing to the
homogeneous form
-- sourceFormat nextAfter(source, source).
Remove 7.4.