On 15.10.21 16:20, Jakub Jelinek wrote: [...]
when one compiles integer function foo () foo = precision (0.0_16) end function foo integer function bar () bar = range (0.0_16) end function bar with -mabi=ibmlongdouble, I see 31 and 291, while with -mabi=ieeelongdouble 33 and 4931. The 0.0_8 precision/range values are 15 and 307, so neither precision of C long double if it is double-double nor range matches anything. If we do implement double-double support, I think KIND=15 would be better than KIND=17, it is true that double-double has for certain numbers much higher precision than IEEE quad, but the precision depends on the numbers and most of the time is smaller, the range is always smaller. And the PRECISION/RANGE intrinsic numbers are also both smaller.
There is one potential problem: selected_real_kind. The standard says about that... # If more than one kind type parameter value meets the criteria, the # value returned is the one with the smallest decimal precision, unless # there are several such values, in which case the smallest of these # kind values is returned So, selected_real_kind(25) would yield double double, and we would have to violate the standard there if we wanted people to have IEEE QP in that case. Best regards Thomas