20#ifndef FOOTAG_FOOTOL_H
21#define FOOTAG_FOOTOL_H
33static inline void footol_nom(
38 tol->min = tol->max = tol->nom = nom;
41static inline void footol_minmax(
49 tol->nom = min + fabs(max - min) / 2;
52static inline void footol_minmaxnom(
64static inline void footol_pm(
71 tol->min = nom - fabs(plusminus);
72 tol->max = nom + fabs(plusminus);
75static inline struct footol footol_auto(
81 if (fabs(b) < fabs(a)) {
82 footol_pm(&ret, a, b);
84 footol_minmax(&ret, a, b);
89static inline double footol_range(
90 const struct footol *
const tol
93 return tol->max - tol->min;
96static const double FOOTOL_MM_PER_INCH = 25.4;
98static inline double footol_inchtomm(
102 return mmval * FOOTOL_MM_PER_INCH;
105static inline struct footol footol_autoi(
110 return footol_auto(footol_inchtomm(a), footol_inchtomm(b));