[Cfp-interest 1617] intmax_t removal

Jim Thomas jaswthomas at sbcglobal.net
Wed Jun 3 15:08:21 PDT 2020


The WG14 paper:

n2525: remove the fromfp, ufromfp, fromfpx, ufromfpx, and other intmax_t functions

as the title says proposes removing the functions frumfp, etc., because they return intmax_t which WG14 has voted to remove from C2X.

These functions support required operations in IEC 60559. We could consider changing the return type from intmax_t to the floating type in the parameter list. E.g., change:

intmax_t fromfp(double x, int round, unsigned int width);

to:

double fromfp(double x, int round, unsigned int width);

where the value of the result is the same as before, though represented in floating type. Also, as before, a conversion to the integer type could be obtained by converting the function result to the integer type by assignment or cast.

We’ve also used intmax_t for the integer parameters for some of the math functions (pown, compoundn, rootn). We could consider changing the type to long long int. 

This issue will be on the agenda for the June CFP meeting.

- Jim Thomas


More information about the Cfp-interest mailing list