godot_core/builtin/math/
mod.rs

1/*
2 * Copyright (c) godot-rust; Bromeon and contributors.
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
6 */
7
8mod approx_eq;
9mod float;
10mod glam_helpers;
11mod xform;
12
13pub use approx_eq::ApproxEq;
14pub use float::FloatExt;
15// Internal glam re-exports
16pub(crate) use glam_helpers::*;
17pub use xform::XformInv;
18
19pub use crate::{assert_eq_approx, assert_ne_approx};
20
21#[cfg(test)] #[cfg_attr(published_docs, doc(cfg(test)))]
22mod test {
23    use super::*;
24
25    #[test]
26    fn equal_approx() {
27        assert_eq_approx!(1.0, 1.000001);
28        assert_ne_approx!(1.0, 2.0);
29        assert_eq_approx!(1.0, 1.000001, "Message {}", "formatted");
30        assert_ne_approx!(1.0, 2.0, "Message {}", "formatted");
31    }
32}