Skip to main content

use_math/
prelude.rs

1/// Commonly used facade items.
2#[cfg(feature = "arithmetic")]
3pub use crate::{
4    checked_add, checked_div_ceil, checked_div_floor, checked_is_divisible_by, checked_lcm,
5    checked_mod_floor, checked_mul, checked_sub, div_ceil, div_floor, mod_floor, saturating_add,
6    saturating_mul, saturating_sub, wrapping_add, wrapping_mul, wrapping_sub,
7};
8
9#[cfg(feature = "algebra")]
10pub use crate::{
11    has_inverses, identity_element, is_abelian_group, is_associative, is_closed_under,
12    is_commutative, is_distributive_over, is_group, is_monoid, is_ring,
13};
14
15#[cfg(feature = "catalan")]
16pub use crate::{CatalanError, catalan, fuss_catalan};
17
18#[cfg(feature = "calculus")]
19pub use crate::{
20    CalculusError, Differentiator, IntegrationInterval, Integrator, LimitApproximator,
21    central_difference, second_central_difference, simpson_integral, symmetric_limit,
22    trapezoidal_integral,
23};
24
25#[cfg(feature = "combinatorics")]
26pub use crate::{CombinatoricsError, combinations, factorial, permutations};
27
28#[cfg(feature = "complex")]
29pub use crate::{Complex, Imaginary};
30
31#[cfg(feature = "geometry")]
32pub use crate::{
33    Aabb2, Circle, GeometryError, Line2, Orientation2, Point2, Segment2, Triangle, Vector2,
34    aabb_from_points, distance_2d, distance_squared_2d, midpoint_2d, orientation_2d,
35    orientation_2d_with_tolerance, triangle_area, triangle_twice_area, triangle_twice_signed_area,
36    try_orientation_2d, try_orientation_2d_with_tolerance,
37};
38
39#[cfg(feature = "geode")]
40pub use crate::{
41    GeodeError, TypeVector, face_count, geode_memoized, hyper_catalan, polygon_edge_count,
42    polygon_vertex_count,
43};
44
45#[cfg(feature = "geode")]
46pub use crate::geode::geode;
47
48#[cfg(feature = "integer")]
49pub use crate::{
50    IntegerError, IntegerSign, are_coprime, classify_sign, gcd, is_divisible_by, is_even, is_odd,
51    lcm,
52};
53
54#[cfg(feature = "logic")]
55pub use crate::{equivalence, exclusive_or, implication, majority, nand, nor};
56
57#[cfg(feature = "linear")]
58pub use crate::{LinearError, LinearVector2, Matrix2, dot, solve_2x2};
59
60#[cfg(feature = "number")]
61pub use crate::{
62    GOLDEN_RATIO, GOLDEN_RATIO_F32, NumberCategory, NumberSign, SQRT_3, SQRT_3_F32,
63    classify_number, classify_number_sign, is_finite_number,
64};
65
66#[cfg(feature = "probability")]
67pub use crate::{
68    Bernoulli, Probability, ProbabilityError, independent_intersection, independent_union,
69};
70
71#[cfg(feature = "rational")]
72pub use crate::{Rational, RationalError};
73
74#[cfg(feature = "real")]
75pub use crate::{Real, RealError, RealInterval, approx_eq};
76
77#[cfg(feature = "series")]
78pub use crate::{
79    SeriesError, arithmetic_nth_term, arithmetic_sum, geometric_nth_term, geometric_sum,
80};
81
82#[cfg(feature = "set")]
83pub use crate::{
84    are_disjoint, contains_member, is_subset, set_difference, set_intersection,
85    set_symmetric_difference, set_union,
86};
87
88#[cfg(feature = "statistics")]
89pub use crate::{
90    StatisticsError, mean, median, population_std_dev, population_variance, sample_std_dev,
91    sample_variance,
92};
93
94#[cfg(feature = "trigonometry")]
95pub use crate::{
96    Angle, cos_deg, degrees_to_radians, normalize_degrees, normalize_radians, radians_to_degrees,
97    sin_deg, tan_deg,
98};