Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
const_functions.h
1#pragma once
2#include <cstdint>
3
4constexpr uint32_t rshift_round(uint32_t value, uint32_t rshift) {
5 return (value + (1 << (rshift - 1))) >> rshift; // (Rohan) I never was quite 100% sure of this...
6}
7
8constexpr int32_t rshift_round_signed(int32_t value, uint32_t rshift) {
9 return (value + (1 << (rshift - 1))) >> rshift; // (Rohan) I never was quite 100% sure of this...
10}
11
13inline constexpr int32_t mod(int32_t a, int32_t b) {
14 return ((a % b) + b) % b;
15}