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

Method makeIndexKey

src/common/Int128.cpp:656–676  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

654{
655
656ULONG Int128::makeIndexKey(vary* buf, int exp)
657{
658 fb_assert(-128 <= exp && exp <= 127);
659
660 unsigned char coeff[PMAX + 2];
661 unsigned char* c = &coeff[PMAX];
662
663 for (Int128 v = sign() > 0 ? -*this : *this ; v.sign(); )
664 {
665 int m;
666 v.divMod(10, &m);
667
668 fb_assert(-m < 10);
669 fb_assert(c > coeff);
670 *--c = -m;
671 }
672
673 memset(coeff, 0, c - coeff);
674
675 return Decimal128::makeBcdKey(buf, coeff, sign() < 0, exp, BIAS, PMAX);
676}
677
678} // namespace Firebird
679

Callers 1

compressFunction · 0.45

Calls 3

signFunction · 0.85
divModMethod · 0.80
signMethod · 0.45

Tested by

no test coverage detected