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

Function decFloatIsNormal

extern/decNumber/decBasic.c:2427–2435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2425 return DFISSIGNED(df) && !DFISZERO(df) && !DFISNAN(df);
2426 }
2427uInt decFloatIsNormal(const decFloat *df) {
2428 Int exp; // exponent
2429 if (DFISSPECIAL(df)) return 0;
2430 if (DFISZERO(df)) return 0;
2431 // is finite and non-zero
2432 exp=GETEXPUN(df) // get unbiased exponent ..
2433 +decFloatDigits(df)-1; // .. and make adjusted exponent
2434 return (exp>=DECEMIN); // < DECEMIN is subnormal
2435 }
2436uInt decFloatIsPositive(const decFloat *df) {
2437 return !DFISSIGNED(df) && !DFISZERO(df) && !DFISNAN(df);
2438 }

Callers 2

decFloatIsSubnormalFunction · 0.85
decFloatNextTowardFunction · 0.85

Calls 1

decFloatDigitsFunction · 0.85

Tested by

no test coverage detected