------------------------------------------------------------------ */ decFloatSubtract -- subtract a decFloat from another */ / result gets the result of subtracting dfr from dfl: */ dfl is the first decFloat (lhs) */ dfr is the second decFloat (rhs) */ set is the context
| 3455 | /* */ |
| 3456 | /* ------------------------------------------------------------------ */ |
| 3457 | decFloat * decFloatSubtract(decFloat *result, |
| 3458 | const decFloat *dfl, const decFloat *dfr, |
| 3459 | decContext *set) { |
| 3460 | decFloat temp; |
| 3461 | // NaNs must propagate without sign change |
| 3462 | if (DFISNAN(dfr)) return decFloatAdd(result, dfl, dfr, set); |
| 3463 | temp=*dfr; // make a copy |
| 3464 | DFBYTE(&temp, 0)^=0x80; // flip sign |
| 3465 | return decFloatAdd(result, dfl, &temp, set); // and add to the lhs |
| 3466 | } // decFloatSubtract |
| 3467 | |
| 3468 | /* ------------------------------------------------------------------ */ |
| 3469 | /* decFloatToInt -- round to 32-bit binary integer (4 flavours) */ |
nothing calls this directly
no test coverage detected