[Cfp-interest 1668] Re: intmax_t removal
Fred J. Tydeman
tydeman at tybor.com
Thu Jun 25 16:49:21 PDT 2020
On Thu, 25 Jun 2020 10:12:18 -0700 Jim Thomas wrote:
>
>> Not so sure about that.
>> Consider both: compoundn( DBL_MIN, 1.0/DBL_MIN ) and compoundn( 1.0/DBL_MAX, DBL_MAX )
>> They should have the value 2.718281828...
>> They need the 'n' argument to be the same type as the 'x' argument for that to work.
Even for normal cases, how would one do a loan for 3.5 years?
Having 'n' be integer would not allow for that.
>> Also, consider pownl( 1.L+LDBL_EPSILON, 1.L/LDBL_EPSILON )
>> Again, it should have the value 2.718281828...
>> If long double is the 128-bit IEEE-754 format, then one needs a 113-bit integer
>> to hold the value 1.L/LDBL_EPSILON. long long int is only required to hold 64 bits.
>
>Why not use pow or powr for these calculations? Maybe David or Mike can say more about what 754 intended for compoundn, pown, and rootn.
OK, I see your point here.
>These functions are in TS 18661-4 and have been implemented with integer type second parameters. We should have a very good reason for changing them.
Changing to 'long long int' is a change (but not as drastic my using floating-point).
---
Fred J. Tydeman Tydeman Consulting
tydeman at tybor.com Testing, numerics, programming
+1 (702) 608-6093 Vice-chair of PL22.11 (ANSI "C")
Sample C99+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.
More information about the Cfp-interest
mailing list