omega-bridge
Omega-first language interoperability: checked conversion backends and native language bindings
Brought by drakestapleton
omega-bridge / evidence / deepinfer / cxx / floor_prefix.verbatim
| 1 | static int64_t floor_prefix(int64_t n, int64_t ratio) { |
| 2 | const int64_t blocks = n / ratio; |
| 3 | return blocks * (n + 1) - ratio * blocks * (blocks + 1) / 2; |
| 4 | } |