I am trying to print __float128 using libquadmath, for example:
quadmath_snprintf(s, sizeof(s), "%.30Qg", f);
With the following three constants:
The result should correspond to the following version:
number = [ minus ] int [ frac ] [ exp ] decimal-point = %x2E ; . digit1-9 = %x31-39 ; 1-9 e = %x65 / %x45 ; e E exp = e [ minus / plus ] 1*DIGIT frac = decimal-point 1*DIGIT int = zero / ( digit1-9 *DIGIT ) minus = %x2D ; - plus = %x2B ; + zero = %x30 ; 0
For any input __float128 "i" that was printed on a line corresponding to the above production "s" and then "s" is scanned back to __float128 "j" - "i" must be bitwise to "j" - i.e. no information should be lost. For at least some values, this is impossible (NaN, Infinity), what is the complete list of these values?
There should not be another line that satisfies the two above criteria, shorter than the candidate.
Is there a quadmath_snprintf format string that satisfies the above (1, 3, and 2 when possible)? If so, what is it?
What are the __float128 values that cannot be represented accurately enough to satisfy paragraph 2 of the above statement? (e.g. Nan, +/- Infinity, etc.) How do I determine if __float128 supports one of these values?
source share