]> git.lyx.org Git - lyx.git/blob - src/support/lyxlib.h
Fix LaTeX length export of big numbers (bug 9416)
[lyx.git] / src / support / lyxlib.h
1 // -*- C++ -*-
2 /**
3  * \file lyxlib.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * A selection of useful system functions made
8  * handy for C++ usage.
9  *
10  * \author Lars Gullik Bjønnes
11  *
12  * Full author contact details are available in file CREDITS.
13  */
14
15 #ifndef LYX_LIB_H
16 #define LYX_LIB_H
17
18 namespace lyx {
19 namespace support {
20
21 /// FIXME: some point to this hmm ?
22 int kill(int pid, int sig);
23
24 /**
25  * Returns true if var is approximately equal to number with allowed error
26  * of 'error'.
27  *
28  * Usage: if (float_equal(var, number, 0.0001)) { }
29  *
30  * This will check if 'var' is approx. equal to 'number' with error of 1/1000
31  */
32 inline bool float_equal(double var, double number, double error)
33 {
34         return (number - error <= var && var <= number + error);
35 }
36
37 } // namespace support
38 } // namespace lyx
39
40 #endif /* LYX_LIB_H */