27#ifndef PED_NATMATH_H_INCLUDED
28#define PED_NATMATH_H_INCLUDED
37#define PED_MIN(a, b) ( ((a)<(b)) ? (a) : (b) )
38#define PED_MAX(a, b) ( ((a)>(b)) ? (a) : (b) )
99 return (numerator + divisor - 1) / divisor;
106 return (numerator + divisor/2) / divisor;
offset
Definition fdasd.h:264
PedSector ped_alignment_align_nearest(const PedAlignment *align, const PedGeometry *geom, PedSector sector)
This function returns the sector that is closest to sector, satisfies the align constraint and lies i...
Definition natmath.c:449
const PedAlignment * ped_alignment_none
Definition natmath.c:53
PedSector ped_round_to_nearest(PedSector sector, PedSector grain_size)
Definition natmath.c:92
void ped_alignment_destroy(PedAlignment *align)
Free up memory associated with align.
Definition natmath.c:173
PedSector ped_round_up_to(PedSector sector, PedSector grain_size)
Definition natmath.c:82
struct _PedAlignment PedAlignment
Definition natmath.h:31
PedAlignment * ped_alignment_new(PedSector offset, PedSector grain_size)
Return an alignment object (used by PedConstraint), representing all PedSector's that are of the form...
Definition natmath.c:150
const PedAlignment * ped_alignment_any
Definition natmath.c:52
PedAlignment * ped_alignment_intersect(const PedAlignment *a, const PedAlignment *b)
This function computes a PedAlignment object that describes the intersection of two alignments.
Definition natmath.c:296
PedSector ped_alignment_align_up(const PedAlignment *align, const PedGeometry *geom, PedSector sector)
This function returns the closest sector to sector that lies inside geom that satisfies the given ali...
Definition natmath.c:380
int ped_alignment_is_aligned(const PedAlignment *align, const PedGeometry *geom, PedSector sector)
This function returns 1 if sector satisfies the alignment constraint align and lies inside geom.
Definition natmath.c:465
PedSector ped_alignment_align_down(const PedAlignment *align, const PedGeometry *geom, PedSector sector)
This function returns the closest sector to sector that lies inside geom that satisfies the given ali...
Definition natmath.c:408
PedAlignment * ped_alignment_duplicate(const PedAlignment *align)
Return a duplicate of align.
Definition natmath.c:182
PedSector ped_greatest_common_divisor(PedSector a, PedSector b)
Definition natmath.c:104
int ped_alignment_init(PedAlignment *align, PedSector offset, PedSector grain_size)
Initialize a preallocated piece of memory for an alignment object (used by PedConstraint).
Definition natmath.c:129
PedSector ped_round_down_to(PedSector sector, PedSector grain_size)
Definition natmath.c:73
long long PedSector
We can address 2^63 sectors.
Definition device.h:31
struct _PedGeometry PedGeometry
Definition geom.h:30
uint8_t sector
Definition pc98.c:7
PedSector grain_size
Definition natmath.h:59