+2008-05-16 Doug Kwan <dougkwan@google.com>
+
+ * real.c (real_to_decimal, real_to_hexadecimal): Distinguish
+ QNaN & SNaN.
+ (real_from_string): Handle NaNs and Inf as approriate.
+
2008-05-16 Nathan Froyd <froydnj@codesourcery.com>
* doc/gty.texi (Source Files Containing Type Information): Note
return;
case rvc_nan:
/* ??? Print the significand as well, if not canonical? */
- strcpy (str, (r.sign ? "-NaN" : "+NaN"));
+ sprintf (str, "%c%cNaN", (r_orig->sign ? '-' : '+'),
+ (r_orig->signalling ? 'S' : 'Q'));
return;
default:
gcc_unreachable ();
return;
case rvc_nan:
/* ??? Print the significand as well, if not canonical? */
- strcpy (str, (r->sign ? "-NaN" : "+NaN"));
+ sprintf (str, "%c%cNaN", (r->sign ? '-' : '+'),
+ (r->signalling ? 'S' : 'Q'));
return;
default:
gcc_unreachable ();
else if (*str == '+')
str++;
+ if (!strncmp (str, "QNaN", 4))
+ {
+ get_canonical_qnan (r, sign);
+ return 0;
+ }
+ else if (!strncmp (str, "SNaN", 4))
+ {
+ get_canonical_snan (r, sign);
+ return 0;
+ }
+ else if (!strncmp (str, "Inf", 3))
+ {
+ get_inf (r, sign);
+ return 0;
+ }
+
if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X'))
{
/* Hexadecimal floating point. */