1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use Scalar;
/// A [`Scalar`] type that can report its own machine epsilon, so callers don't have to supply
/// a numerical tolerance by hand for every approximate-zero comparison.
///
/// Kept separate from [`Scalar`] itself, rather than as a method on it, so that a future
/// `Scalar` implementor with no meaningful notion of machine epsilon (e.g. a fixed-point or
/// exact-rational type) isn't forced to answer a question that doesn't apply to it just to
/// satisfy this convenience: it can still implement `Scalar` alone and use every function that
/// takes an explicit tolerance.
///
/// # Examples
///
/// ```
/// use rustebra::scalar::FloatTolerance;
///
/// assert_eq!(f64::epsilon(), f64::EPSILON);
/// ```