MCPcopy Create free account
hub / github.com/covscript/covscript / truncate

Method truncate

include/covscript/core/core.hpp:1210–1213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1208 virtual ~extension() = default;
1209
1210 static inline int truncate(int n, int m)
1211 {
1212 return n == 0 ? 0 : n / int(std::pow(10, (std::max) (int(std::log10(std::abs(n))) - (std::max) (m, 0) + 1, 0)));
1213 }
1214
1215 explicit extension(std::string_view path)
1216 {

Callers

nothing calls this directly

Calls 3

log10Function · 0.85
absFunction · 0.85
powFunction · 0.50

Tested by

no test coverage detected