interplane.Get Omega
Read in your language

omega-bridge

Omega-first language interoperability: checked conversion backends and native language bindings

Brought by drakestapleton

branch main Branches Tags History

omega-bridge / evidence / deepinfer / cxx / capped_prefix.hdr-c

5 lines · 200 bytes Raw Blame History
1#include <stdint.h>
2static int64_t capped_prefix(int64_t n, int64_t ratio, int64_t cap) {
3 const int64_t stop = std::min(n, ratio * cap);
4 return floor_prefix(stop, ratio) + (n - stop) * cap;
5}