------------------------------------------------------------------ */ decNaNs -- handle NaN argument(s) */ / result gets the result of handling dfl and dfr, one or both of */ which is a NaN */ dfl is the first decFloat (lhs) */ dfr is the second decFloat (rhs) -- may be NULL for a sing
| 3593 | /* to a qNaN and Invalid operation is set. */ |
| 3594 | /* ------------------------------------------------------------------ */ |
| 3595 | static decFloat *decNaNs(decFloat *result, |
| 3596 | const decFloat *dfl, const decFloat *dfr, |
| 3597 | decContext *set) { |
| 3598 | // handle sNaNs first |
| 3599 | if (dfr!=NULL && DFISSNAN(dfr) && !DFISSNAN(dfl)) dfl=dfr; // use RHS |
| 3600 | if (DFISSNAN(dfl)) { |
| 3601 | decCanonical(result, dfl); // propagate canonical sNaN |
| 3602 | DFWORD(result, 0)&=~(DECFLOAT_qNaN ^ DECFLOAT_sNaN); // quiet |
| 3603 | set->status|=DEC_Invalid_operation; |
| 3604 | return result; |
| 3605 | } |
| 3606 | // one or both is a quiet NaN |
| 3607 | if (!DFISNAN(dfl)) dfl=dfr; // RHS must be NaN, use it |
| 3608 | return decCanonical(result, dfl); // propagate canonical qNaN |
| 3609 | } // decNaNs |
| 3610 | |
| 3611 | /* ------------------------------------------------------------------ */ |
| 3612 | /* decNumCompare -- numeric comparison of two decFloats */ |
no test coverage detected