More NaN constant fixes.

This patch cleans up %loadi/wr regarding NaN values. It also
fixes the code generator to correctly output a NaN value as
a Cr<> constant.
This commit is contained in:
Cary R 2008-08-28 18:33:13 -07:00 committed by Stephen Williams
parent 2d3cd7cb9a
commit 2e97b28185
2 changed files with 5 additions and 1 deletions

View File

@ -330,6 +330,10 @@ char* draw_Cr_to_string(double value)
snprintf(tmp, sizeof(tmp), "Cr<m0g7fff>");
return strdup(tmp);
}
if (value != value) {
snprintf(tmp, sizeof(tmp), "Cr<m1g3fff>");
return strdup(tmp);
}
int sign = 0;
if (value < 0) {

View File

@ -2663,7 +2663,7 @@ bool of_LOADI_WR(vthread_t thr, vvp_code_t cp)
return true;
}
// Detect NaN
if (exp==0x3fff && cp->number!=0) {
if (exp==0x3fff) {
thr->words[idx].w_real = nan("");
return true;
}