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

Function decFloatAbs

extern/decNumber/decBasic.c:1069–1075  ·  view source on GitHub ↗

------------------------------------------------------------------ */ decFloatAbs -- absolute value, heeding NaNs, etc. */ / result gets the canonicalized df with sign 0 */ df is the decFloat to abs */ set is the context */ returns result

Source from the content-addressed store, hash-verified

1067/* will signal) and the result will be canonical. */
1068/* ------------------------------------------------------------------ */
1069decFloat * decFloatAbs(decFloat *result, const decFloat *df,
1070 decContext *set) {
1071 if (DFISNAN(df)) return decNaNs(result, df, NULL, set);
1072 decCanonical(result, df); // copy and check
1073 DFBYTE(result, 0)&=~0x80; // zero sign bit
1074 return result;
1075 } // decFloatAbs
1076
1077/* ------------------------------------------------------------------ */
1078/* decFloatAdd -- add two decFloats */

Callers

nothing calls this directly

Calls 2

decCanonicalFunction · 0.85
decNaNsFunction · 0.70

Tested by

no test coverage detected