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

Function decFloatGetCoefficient

extern/decNumber/decCommon.c:1062–1069  ·  view source on GitHub ↗

------------------------------------------------------------------ */ decFloatGetCoefficient -- get coefficient as BCD8 */ / df is the decFloat from which to extract the coefficient */ bcdar is where DECPMAX bytes will be written, one BCD digit in */ each byte (BCD8 encoding); if df is a NaN the first byte will */ be zero, and if it is infinite they will all be zero

Source from the content-addressed store, hash-verified

1060/* payload of a qNaN or sNaN. */
1061/* ------------------------------------------------------------------ */
1062Int decFloatGetCoefficient(const decFloat *df, uByte *bcdar) {
1063 if (DFISINF(df)) memset(bcdar, 0, DECPMAX);
1064 else {
1065 GETCOEFF(df, bcdar); // use macro
1066 if (DFISNAN(df)) bcdar[0]=0; // MSD needs correcting
1067 }
1068 return GETSIGN(df);
1069 } // decFloatGetCoefficient
1070
1071/* ------------------------------------------------------------------ */
1072/* decFloatGetExponent -- get unbiased exponent */

Callers 1

decFloatSetExponentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected