[Cfp-interest 1672] Re: intmax_t removal

Mike Cowlishaw mfc at speleotrove.com
Fri Jun 26 05:52:40 PDT 2020


 
> >> 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.

That's an advantage of the non-normalised form used for 754 decimals --
integers are are proper subset of the floats, with exponent==0.  There's
really no need for separate integer types at all.   (Some say that integer
types are needed for efficiency, and that was true 40 years ago, but on
32-bit+ architectures today integer multiply and divide are often slower
than the floating-point operations...)

Mike



More information about the Cfp-interest mailing list