MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / CheckedMod

Function CheckedMod

internal/overflow.cc:145–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145absl::StatusOr<int64_t> CheckedMod(int64_t x, int64_t y) {
146 CEL_RETURN_IF_ERROR(
147 CheckRange(x != kInt64Min || y != -1, "integer overflow"));
148 CEL_RETURN_IF_ERROR(CheckArgument(y != 0, "modulus by zero"));
149 return x % y;
150}
151
152absl::StatusOr<uint64_t> CheckedAdd(uint64_t x, uint64_t y) {
153#if ABSL_HAVE_BUILTIN(__builtin_add_overflow)

Callers 3

overflow_test.ccFile · 0.85
Modulo<int64_t>Function · 0.85
Modulo<uint64_t>Function · 0.85

Calls 2

CheckRangeFunction · 0.85
CheckArgumentFunction · 0.85

Tested by

no test coverage detected