MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / decFloatSubtract

Function decFloatSubtract

extern/decNumber/decBasic.c:3457–3466  ·  view source on GitHub ↗

------------------------------------------------------------------ */ 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

Source from the content-addressed store, hash-verified

3455/* */
3456/* ------------------------------------------------------------------ */
3457decFloat * 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) */

Callers

nothing calls this directly

Calls 1

decFloatAddFunction · 0.85

Tested by

no test coverage detected