MCPcopy Create free account
hub / github.com/Singular/Singular / bytesToString

Function bytesToString

libpolys/tests/cxxtest/ValueTraits.cpp:82–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80 }
81
82 char *bytesToString( const unsigned char *bytes, unsigned numBytes, unsigned maxBytes, char *s )
83 {
84 bool truncate = (numBytes > maxBytes);
85 if ( truncate )
86 numBytes = maxBytes;
87
88 s = copyString( s, "{ " );
89 for ( unsigned i = 0; i < numBytes; ++ i, ++ bytes )
90 s = copyString( copyString( s, byteToHex( *bytes ) ), " " );
91 if ( truncate )
92 s = copyString( s, "..." );
93 return copyString( s, " }" );
94 }
95
96#ifndef CXXTEST_USER_VALUE_TRAITS
97 unsigned ValueTraits<const double>::requiredDigitsOnLeft( double t )

Callers 1

ValueTraitsMethod · 0.85

Calls 2

copyStringFunction · 0.85
byteToHexFunction · 0.85

Tested by

no test coverage detected