Ardour  9.0-pre0-350-gf17a656217
integer_division.h File Reference
#include <cstdint>
#include <boost/multiprecision/cpp_int.hpp>
#include "pbd/error.h"
Include dependency graph for integer_division.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 PBD
 

Macros

#define PBD_IDIV_ASR(x)   ((x) < 0 ? -1 : 0)
 
#define PBD_IDIV_ROUNDING(x, y)   ( (y)/2 - (PBD_IDIV_ASR((x)^(y)) & (y)))
 

Functions

template<typename T >
int_div_round (T x, T y)
 
int64_t PBD::muldiv_round (int64_t v, int64_t n, int64_t d)
 
int64_t PBD::muldiv_floor (int64_t v, int64_t n, int64_t d)
 

Macro Definition Documentation

◆ PBD_IDIV_ASR

#define PBD_IDIV_ASR (   x)    ((x) < 0 ? -1 : 0)

Definition at line 28 of file integer_division.h.

◆ PBD_IDIV_ROUNDING

#define PBD_IDIV_ROUNDING (   x,
 
)    ( (y)/2 - (PBD_IDIV_ASR((x)^(y)) & (y)))

Definition at line 36 of file integer_division.h.

Function Documentation

◆ int_div_round()

template<typename T >
T int_div_round ( x,
y 
)

Definition at line 39 of file integer_division.h.