D
Dik T. Winter
> Should it be 2.0 > DBL_MAX / (FLT_RADIX-DBL_EPSILON) to be precise? In
> general since we have greater e-max than p, the precision matters when
> inspecting whether or not a positive integer can be represented with
> the given radix.
If e_max >= p, the largest positive integer that is representable is
DBL_MAX. If e_max < p, it is b ** e_max - 1.
To determine whether an arbitrary integer can be represented takes quite
a bit of work. But this is all moot. The largest positive integer
such that all integers from 0 to that integer can be represented is:
b ** p
or FLT_RADIX ** xxx_MANT_DIG when e_max >= p, else it is xxx_MAX.
If e_max >= p and assuming p > 0, the first formula gives at least 2.
So if 2.0 is not representable, we have e_max < p, and the additional
requirement that 2.0 > xxx_MAX.
I ignored e-min in the analysis. But if e_min > p you will find some
pretty strange things. I do not find it in the standard, but apparently
that is allowed. And if that is the case, even 1.0 is not representable.
In fact, if e_min > p, the smallest positive integer that is
representable is b ** (e_min - p).