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

Function CheckedDoubleToUint64

internal/overflow.cc:309–314  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307}
308
309absl::StatusOr<uint64_t> CheckedDoubleToUint64(double v) {
310 CEL_RETURN_IF_ERROR(
311 CheckRange(std::isfinite(v) && v >= 0 && v < kDoubleTwoTo64,
312 "double out of uint64 range"));
313 return static_cast<uint64_t>(v);
314}
315
316absl::StatusOr<uint64_t> CheckedInt64ToUint64(int64_t v) {
317 CEL_RETURN_IF_ERROR(CheckRange(v >= 0, "int64 out of uint64 range"));

Callers 2

overflow_test.ccFile · 0.85

Calls 1

CheckRangeFunction · 0.85

Tested by

no test coverage detected