Deluge Firmware
1.3.0
Build date: 2026.08.29
Toggle main menu visibility
Loading...
Searching...
No Matches
const_functions.h
1
#pragma once
2
#include <cstdint>
3
4
constexpr
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
8
constexpr
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
13
inline
constexpr
int32_t mod(int32_t a, int32_t b) {
14
return
((a % b) + b) % b;
15
}