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

Function decFloatClassString

extern/decNumber/decBasic.c:1653–1666  ·  view source on GitHub ↗

------------------------------------------------------------------ */ decFloatClassString -- return the class of a decFloat as a string */ / df is the decFloat to test */ returns a constant string describing the class df falls into */ ------------------------------------------------------------------ */

Source from the content-addressed store, hash-verified

1651/* returns a constant string describing the class df falls into */
1652/* ------------------------------------------------------------------ */
1653const char *decFloatClassString(const decFloat *df) {
1654 enum decClass eclass=decFloatClass(df);
1655 if (eclass==DEC_CLASS_POS_NORMAL) return DEC_ClassString_PN;
1656 if (eclass==DEC_CLASS_NEG_NORMAL) return DEC_ClassString_NN;
1657 if (eclass==DEC_CLASS_POS_ZERO) return DEC_ClassString_PZ;
1658 if (eclass==DEC_CLASS_NEG_ZERO) return DEC_ClassString_NZ;
1659 if (eclass==DEC_CLASS_POS_SUBNORMAL) return DEC_ClassString_PS;
1660 if (eclass==DEC_CLASS_NEG_SUBNORMAL) return DEC_ClassString_NS;
1661 if (eclass==DEC_CLASS_POS_INF) return DEC_ClassString_PI;
1662 if (eclass==DEC_CLASS_NEG_INF) return DEC_ClassString_NI;
1663 if (eclass==DEC_CLASS_QNAN) return DEC_ClassString_QN;
1664 if (eclass==DEC_CLASS_SNAN) return DEC_ClassString_SN;
1665 return DEC_ClassString_UN; // Unknown
1666 } // decFloatClassString
1667
1668/* ------------------------------------------------------------------ */
1669/* decFloatCompare -- compare two decFloats; quiet NaNs allowed */

Callers

nothing calls this directly

Calls 1

decFloatClassFunction · 0.85

Tested by

no test coverage detected