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

Function CheckedDiv

internal/overflow.cc:138–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138absl::StatusOr<int64_t> CheckedDiv(int64_t x, int64_t y) {
139 CEL_RETURN_IF_ERROR(
140 CheckRange(x != kInt64Min || y != -1, "integer overflow"));
141 CEL_RETURN_IF_ERROR(CheckArgument(y != 0, "divide by zero"));
142 return x / y;
143}
144
145absl::StatusOr<int64_t> CheckedMod(int64_t x, int64_t y) {
146 CEL_RETURN_IF_ERROR(

Callers 3

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

Calls 2

CheckRangeFunction · 0.85
CheckArgumentFunction · 0.85

Tested by

no test coverage detected