Skip to main content

malachite_float/float/arithmetic/
mod.rs

1// Copyright © 2026 Mikhail Hogrefe
2//
3// This file is part of Malachite.
4//
5// Malachite is free software: you can redistribute it and/or modify it under the terms of the GNU
6// Lesser General Public License (LGPL) as published by the Free Software Foundation; either version
7// 3 of the License, or (at your option) any later version. See <https://www.gnu.org/licenses/>.
8
9/// Absolute value of [`Float`](super::Float)s.
10pub mod abs;
11/// Implementations of [`AbsSquared`](malachite_base::num::arithmetic::traits::AbsSquared) and
12/// [`AbsSquaredAssign`](malachite_base::num::arithmetic::traits::AbsSquaredAssign), traits for
13/// computing the squared absolute value of a number. For real types this is the same as squaring.
14pub mod abs_squared;
15/// Implementations of [`Acos`](malachite_base::num::arithmetic::traits::Acos) and
16/// [`AcosAssign`](malachite_base::num::arithmetic::traits::AcosAssign), traits for computing the
17/// arccosine of [`Float`](super::Float)s.
18pub mod acos;
19/// Implementations of [`Acosh`](malachite_base::num::arithmetic::traits::Acosh) and
20/// [`AcoshAssign`](malachite_base::num::arithmetic::traits::AcoshAssign), traits for computing the
21/// inverse hyperbolic cosine of [`Float`](super::Float)s.
22pub mod acosh;
23pub mod acot;
24/// Implementations of [`Acoth`](malachite_base::num::arithmetic::traits::Acoth) and
25/// [`AcothAssign`](malachite_base::num::arithmetic::traits::AcothAssign), traits for computing the
26/// inverse hyperbolic cotangent of [`Float`](super::Float)s.
27pub mod acoth;
28pub mod acsc;
29/// Implementations of [`Acsch`](malachite_base::num::arithmetic::traits::Acsch) and
30/// [`AcschAssign`](malachite_base::num::arithmetic::traits::AcschAssign), traits for computing the
31/// inverse hyperbolic cosecant of [`Float`](super::Float)s.
32pub mod acsch;
33/// Addition of [`Float`](super::Float)s, and of [`Float`](super::Float)s with
34/// [`Rational`](malachite_q::Rational)s.
35pub mod add;
36/// [`AddMul`](malachite_base::num::arithmetic::traits::AddMul) and
37/// [`AddMulAssign`](malachite_base::num::arithmetic::traits::AddMulAssign), traits for adding a
38/// [`Float`](super::Float) and the product of two other [`Float`](super::Float)s — or of a
39/// [`Float`](super::Float) and a [`Rational`](malachite_q::Rational) — with a single rounding
40/// (fused multiply-add), and the associated precision- and rounding-mode-aware functions.
41pub mod add_mul;
42/// Taking the AGM (arithmetic-geometric mean) of two [`Float`](super::Float)s, and of
43/// [`Float`](super::Float)s with [`Rational`](malachite_q::Rational)s.
44pub mod agm;
45/// Implementations of [`Asec`](malachite_base::num::arithmetic::traits::Asec) and
46/// [`AsecAssign`](malachite_base::num::arithmetic::traits::AsecAssign), traits for computing the
47/// arcsecant of [`Float`](super::Float)s.
48pub mod asec;
49/// Implementations of [`Asech`](malachite_base::num::arithmetic::traits::Asech) and
50/// [`AsechAssign`](malachite_base::num::arithmetic::traits::AsechAssign), traits for computing the
51/// inverse hyperbolic secant of [`Float`](super::Float)s.
52pub mod asech;
53/// Implementations of [`Asin`](malachite_base::num::arithmetic::traits::Asin) and
54/// [`AsinAssign`](malachite_base::num::arithmetic::traits::AsinAssign), traits for computing the
55/// arcsine of [`Float`](super::Float)s.
56pub mod asin;
57/// Implementations of [`Asinh`](malachite_base::num::arithmetic::traits::Asinh) and
58/// [`AsinhAssign`](malachite_base::num::arithmetic::traits::AsinhAssign), traits for computing the
59/// inverse hyperbolic sine of [`Float`](super::Float)s.
60pub mod asinh;
61/// Implementations of [`Atan`](malachite_base::num::arithmetic::traits::Atan) and
62/// [`AtanAssign`](malachite_base::num::arithmetic::traits::AtanAssign), traits for computing the
63/// arctangent of [`Float`](super::Float)s.
64pub mod atan;
65/// Implementations of [`Atan2`](malachite_base::num::arithmetic::traits::Atan2) and
66/// [`Atan2Assign`](malachite_base::num::arithmetic::traits::Atan2Assign), traits for computing the
67/// angle of a point given by two [`Float`](super::Float) coordinates.
68pub mod atan2;
69/// Implementations of [`Atanh`](malachite_base::num::arithmetic::traits::Atanh) and
70/// [`AtanhAssign`](malachite_base::num::arithmetic::traits::AtanhAssign), traits for computing the
71/// inverse hyperbolic tangent of [`Float`](super::Float)s.
72pub mod atanh;
73/// [`Average`](malachite_base::num::arithmetic::traits::Average) and
74/// [`AverageAssign`](malachite_base::num::arithmetic::traits::AverageAssign), traits for computing
75/// the average (arithmetic mean) of two numbers, and the associated precision- and
76/// rounding-mode-aware functions.
77///
78/// # average
79/// ```
80/// use malachite_base::num::arithmetic::traits::Average;
81/// use malachite_float::Float;
82///
83/// assert_eq!(Float::from(1.5).average(Float::from(2.5)), 2.0);
84/// assert_eq!((&Float::from(1.5)).average(&Float::from(2.5)), 2.0);
85/// // the output precision is the maximum of the inputs', so the average of two one-bit
86/// // `Float`s is itself rounded to one bit, here to the even neighbor
87/// assert_eq!(Float::from(1.0).average(Float::from(2.0)), 2.0);
88/// // the sum would overflow, but the average is in range
89/// let max = Float::max_finite_value_with_prec(10);
90/// assert_eq!((&max).average(&max), max);
91/// ```
92///
93/// # average_assign
94/// ```
95/// use malachite_base::num::arithmetic::traits::AverageAssign;
96/// use malachite_float::Float;
97///
98/// let mut x = Float::from(1.5);
99/// x.average_assign(Float::from(2.5));
100/// assert_eq!(x, 2.0);
101/// ```
102///
103/// # average_prec_round
104/// ```
105/// use malachite_base::rounding_modes::RoundingMode::*;
106/// use malachite_float::Float;
107/// use std::cmp::Ordering::*;
108///
109/// // the exact average of 1 and 2 is 1.5, which needs 2 bits
110/// let (avg, o) = Float::from(1.0).average_prec_round(Float::from(2.0), 2, Exact);
111/// assert_eq!(avg, 1.5);
112/// assert_eq!(o, Equal);
113///
114/// // at one bit it must be rounded
115/// let (avg, o) = Float::from(1.0).average_prec_round(Float::from(2.0), 1, Floor);
116/// assert_eq!(avg, 1.0);
117/// assert_eq!(o, Less);
118/// let (avg, o) = Float::from(1.0).average_prec_round(Float::from(2.0), 1, Ceiling);
119/// assert_eq!(avg, 2.0);
120/// assert_eq!(o, Greater);
121/// ```
122///
123/// # average_prec
124/// ```
125/// use malachite_float::Float;
126/// use std::cmp::Ordering::*;
127///
128/// let (avg, o) = Float::from(1.0).average_prec(Float::from(2.0), 10);
129/// assert_eq!(avg, 1.5);
130/// assert_eq!(o, Equal);
131/// ```
132///
133/// # average_round
134/// ```
135/// use malachite_base::rounding_modes::RoundingMode::*;
136/// use malachite_float::Float;
137/// use std::cmp::Ordering::*;
138///
139/// // the output precision is the maximum of the inputs' precisions
140/// let (avg, o) = Float::from(1.5).average_round(Float::from(2.5), Nearest);
141/// assert_eq!(avg, 2.0);
142/// assert_eq!(o, Equal);
143/// ```
144///
145/// # average_prec_round_assign
146/// ```
147/// use malachite_base::rounding_modes::RoundingMode::*;
148/// use malachite_float::Float;
149/// use std::cmp::Ordering::*;
150///
151/// let mut x = Float::from(1.0);
152/// assert_eq!(
153///     x.average_prec_round_assign(Float::from(2.0), 1, Floor),
154///     Less
155/// );
156/// assert_eq!(x, 1.0);
157///
158/// let mut x = Float::from(1.0);
159/// assert_eq!(
160///     x.average_prec_round_assign_ref(&Float::from(2.0), 2, Exact),
161///     Equal
162/// );
163/// assert_eq!(x, 1.5);
164/// ```
165///
166/// # average_prec_assign
167/// ```
168/// use malachite_float::Float;
169/// use std::cmp::Ordering::*;
170///
171/// let mut x = Float::from(1.0);
172/// assert_eq!(x.average_prec_assign(Float::from(2.0), 10), Equal);
173/// assert_eq!(x, 1.5);
174///
175/// let mut x = Float::from(1.0);
176/// assert_eq!(x.average_prec_assign_ref(&Float::from(2.0), 10), Equal);
177/// assert_eq!(x, 1.5);
178/// ```
179///
180/// # average_round_assign
181/// ```
182/// use malachite_base::rounding_modes::RoundingMode::*;
183/// use malachite_float::Float;
184/// use std::cmp::Ordering::*;
185///
186/// let mut x = Float::from(1.5);
187/// assert_eq!(x.average_round_assign(Float::from(2.5), Nearest), Equal);
188/// assert_eq!(x, 2.0);
189///
190/// let mut x = Float::from(1.5);
191/// assert_eq!(
192///     x.average_round_assign_ref(&Float::from(2.5), Nearest),
193///     Equal
194/// );
195/// assert_eq!(x, 2.0);
196/// ```
197pub mod average;
198/// An implementation of
199/// [`CanonicalUnitIPow`](malachite_base::num::arithmetic::traits::CanonicalUnitIPow), a trait for
200/// finding the power of $i$ that brings a number into canonical unit form.
201pub mod canonical_unit_i_pow;
202/// Implementations of
203/// [`CanonicalizeGaussianUnit`](malachite_base::num::arithmetic::traits::CanonicalizeGaussianUnit)
204/// and [`CanonicalizeGaussianUnitAssign`](
205/// malachite_base::num::arithmetic::traits::CanonicalizeGaussianUnitAssign), traits for bringing a
206/// number into canonical Gaussian-unit form.
207pub mod canonicalize_gaussian_unit;
208/// Implementations of
209/// [`CanonicalizeUnit`](malachite_base::num::arithmetic::traits::CanonicalizeUnit) and
210/// [`CanonicalizeUnitAssign`](malachite_base::num::arithmetic::traits::CanonicalizeUnitAssign),
211/// traits for bringing a number into canonical unit form.
212pub mod canonicalize_unit;
213/// Cube root of [`Float`](super::Float)s and of [`Rational`](malachite_q::Rational)s.
214pub mod cbrt;
215/// [`Compound`](malachite_base::num::arithmetic::traits::Compound) and
216/// [`CompoundAssign`](malachite_base::num::arithmetic::traits::CompoundAssign), traits for
217/// computing the compound function $(1+x)^n$ for [`Float`](super::Float)s.
218pub mod compound;
219/// Implementations of [`Conjugate`](malachite_base::num::arithmetic::traits::Conjugate) and
220/// [`ConjugateAssign`](malachite_base::num::arithmetic::traits::ConjugateAssign), traits for
221/// computing the complex conjugate of a number. A real number is its own conjugate.
222pub mod conjugate;
223/// Implementations of [`Cos`](malachite_base::num::arithmetic::traits::Cos) and
224/// [`CosAssign`](malachite_base::num::arithmetic::traits::CosAssign), traits for computing the
225/// cosine of [`Float`](super::Float)s.
226pub mod cos;
227/// Implementations of [`Cosh`](malachite_base::num::arithmetic::traits::Cosh) and
228/// [`CoshAssign`](malachite_base::num::arithmetic::traits::CoshAssign), traits for computing the
229/// hyperbolic cosine of [`Float`](super::Float)s.
230pub mod cosh;
231/// Implementations of [`Cot`](malachite_base::num::arithmetic::traits::Cot) and
232/// [`CotAssign`](malachite_base::num::arithmetic::traits::CotAssign), traits for computing the
233/// cotangent of [`Float`](super::Float)s.
234pub mod cot;
235/// Implementations of [`Coth`](malachite_base::num::arithmetic::traits::Coth) and
236/// [`CothAssign`](malachite_base::num::arithmetic::traits::CothAssign), traits for computing the
237/// hyperbolic cotangent of [`Float`](super::Float)s.
238pub mod coth;
239/// Implementations of [`Csc`](malachite_base::num::arithmetic::traits::Csc) and
240/// [`CscAssign`](malachite_base::num::arithmetic::traits::CscAssign), traits for computing the
241/// cosecant of [`Float`](super::Float)s.
242pub mod csc;
243/// Implementations of [`Csch`](malachite_base::num::arithmetic::traits::Csch) and
244/// [`CschAssign`](malachite_base::num::arithmetic::traits::CschAssign), traits for computing the
245/// hyperbolic cosecant of [`Float`](super::Float)s.
246pub mod csch;
247/// Division of [`Float`](super::Float)s, of [`Float`](super::Float)s by
248/// [`Rational`](malachite_q::Rational)s, and of [`Rational`](malachite_q::Rational)s by
249/// [`Float`](super::Float)s.
250pub mod div;
251/// Correctly-rounded dot products of [`Float`](super::Float) slices, with the products computed
252/// exactly and a single rounding at the end, so that intermediate overflow and underflow cannot
253/// occur.
254pub mod dot;
255/// [`Exp`](malachite_base::num::arithmetic::traits::Exp) and
256/// [`ExpAssign`](malachite_base::num::arithmetic::traits::ExpAssign), traits for computing $e^x$
257/// for [`Float`](super::Float)s.
258pub mod exp;
259/// [`ExpXMinus1`](malachite_base::num::arithmetic::traits::ExpXMinus1) and
260/// [`ExpXMinus1Assign`](malachite_base::num::arithmetic::traits::ExpXMinus1Assign), traits for
261/// computing $e^x-1$ for [`Float`](super::Float)s.
262pub mod exp_x_minus_1;
263/// [`factorial_prec_round`](super::Float::factorial_prec_round) and
264/// [`factorial_prec`](super::Float::factorial_prec), for computing correctly-rounded factorials.
265pub mod factorial;
266/// Fractional parts of [`Float`](super::Float)s: the `fractional_part` and
267/// `integer_and_fractional_parts` families.
268pub mod fractional_part;
269/// [`Hypot`](malachite_base::num::arithmetic::traits::Hypot) and
270/// [`HypotAssign`](malachite_base::num::arithmetic::traits::HypotAssign), traits for computing the
271/// hypotenuse of two numbers, $\sqrt{x^2+y^2}$.
272///
273/// # hypot
274/// ```
275/// use core::f64::consts::{E, PI};
276/// use malachite_base::num::arithmetic::traits::Hypot;
277/// use malachite_float::Float;
278///
279/// assert_eq!(
280///     Float::from(PI).hypot(Float::from(E)).to_string(),
281///     "4.1543544023133130"
282/// );
283/// ```
284pub mod hypot;
285/// An implementation of [`IsPowerOf2`](malachite_base::num::arithmetic::traits::IsPowerOf2), a
286/// trait for determining whether a number is an integer power of 2.
287pub mod is_power_of_2;
288/// An implementation of [`IsUnit`](malachite_base::num::arithmetic::traits::IsUnit), a trait for
289/// determining whether a number is a unit of its ring.
290pub mod is_unit;
291/// [`Ln`](malachite_base::num::arithmetic::traits::Ln) and
292/// [`LnAssign`](malachite_base::num::arithmetic::traits::LnAssign), traits for computing the
293/// natural logarithm of [`Float`](super::Float)s.
294pub mod ln;
295/// [`Ln1PlusX`](malachite_base::num::arithmetic::traits::Ln1PlusX) and
296/// [`Ln1PlusXAssign`](malachite_base::num::arithmetic::traits::Ln1PlusXAssign), traits for
297/// computing $\ln(1+x)$ for [`Float`](super::Float)s.
298pub mod ln_1_plus_x;
299/// [`LogBase`](malachite_base::num::arithmetic::traits::LogBase) and
300/// [`LogBaseAssign`](malachite_base::num::arithmetic::traits::LogBaseAssign), traits for computing
301/// the base-$b$ logarithm of [`Float`](super::Float)s for an arbitrary integer base $b>1$.
302pub mod log_base;
303/// [`LogBase10`](malachite_base::num::arithmetic::traits::LogBase10) and
304/// [`LogBase10Assign`](malachite_base::num::arithmetic::traits::LogBase10Assign), traits for
305/// computing the base-10 logarithm of [`Float`](super::Float)s.
306pub mod log_base_10;
307/// [`LogBase10Of1PlusX`](malachite_base::num::arithmetic::traits::LogBase10Of1PlusX) and
308/// [`LogBase10Of1PlusXAssign`](malachite_base::num::arithmetic::traits::LogBase10Of1PlusXAssign),
309/// traits for computing $\log_{10}(1+x)$ of [`Float`](super::Float)s.
310pub mod log_base_10_1_plus_x;
311/// [`LogBaseOf1PlusX`](malachite_base::num::arithmetic::traits::LogBaseOf1PlusX) and
312/// [`LogBaseOf1PlusXAssign`](malachite_base::num::arithmetic::traits::LogBaseOf1PlusXAssign),
313/// traits for computing $\log_b(1+x)$ of [`Float`](super::Float)s for an arbitrary integer base
314/// $b>1$.
315pub mod log_base_1_plus_x;
316/// [`LogBase2`](malachite_base::num::arithmetic::traits::LogBase2) and
317/// [`LogBase2Assign`](malachite_base::num::arithmetic::traits::LogBase2Assign), traits for
318/// computing the base-2 logarithm of [`Float`](super::Float)s.
319pub mod log_base_2;
320/// [`LogBase2Of1PlusX`](malachite_base::num::arithmetic::traits::LogBase2Of1PlusX) and
321/// [`LogBase2Of1PlusXAssign`](malachite_base::num::arithmetic::traits::LogBase2Of1PlusXAssign),
322/// traits for computing $\log_2(1+x)$ for [`Float`](super::Float)s.
323pub mod log_base_2_1_plus_x;
324/// [`LogBase`](malachite_base::num::arithmetic::traits::LogBase) and
325/// [`LogBaseAssign`](malachite_base::num::arithmetic::traits::LogBaseAssign), implemented for a
326/// [`Float`](super::Float) base, for computing $\log_b x$ of a [`Float`](super::Float) with an
327/// arbitrary [`Float`](super::Float) base.
328pub mod log_base_float_base;
329/// [`LogBaseOf1PlusX`](malachite_base::num::arithmetic::traits::LogBaseOf1PlusX) and
330/// [`LogBaseOf1PlusXAssign`](malachite_base::num::arithmetic::traits::LogBaseOf1PlusXAssign),
331/// implemented for a [`Float`](super::Float) base, for computing $\log_b(1+x)$ of a
332/// [`Float`](super::Float) with an arbitrary [`Float`](super::Float) base.
333pub mod log_base_float_base_1_plus_x;
334/// [`LogBasePowerOf2`](malachite_base::num::arithmetic::traits::LogBasePowerOf2) and
335/// [`LogBasePowerOf2Assign`](malachite_base::num::arithmetic::traits::LogBasePowerOf2Assign),
336/// traits for computing $\log_{2^k} x$ for [`Float`](super::Float)s.
337pub mod log_base_power_of_2;
338/// [`LogBasePowerOf2Of1PlusX`](malachite_base::num::arithmetic::traits::LogBasePowerOf2Of1PlusX)
339/// and
340/// [`LogBasePowerOf2Of1PlusXAssign`](malachite_base::num::arithmetic::traits::LogBasePowerOf2Of1PlusXAssign),
341/// traits for computing $\log_{2^k}(1+x)$ for [`Float`](super::Float)s.
342#[cfg_attr(dylint_lib = "malachite_lints", expect(long_lines))]
343pub mod log_base_power_of_2_1_plus_x;
344/// [`LogBase`](malachite_base::num::arithmetic::traits::LogBase) and
345/// [`LogBaseAssign`](malachite_base::num::arithmetic::traits::LogBaseAssign), implemented for a
346/// [`Rational`](malachite_q::Rational) base, for computing $\log_b x$ of a [`Float`](super::Float)
347/// with an arbitrary rational base $b>1$.
348pub mod log_base_rational_base;
349/// [`LogBaseOf1PlusX`](malachite_base::num::arithmetic::traits::LogBaseOf1PlusX) and
350/// [`LogBaseOf1PlusXAssign`](malachite_base::num::arithmetic::traits::LogBaseOf1PlusXAssign),
351/// implemented for a [`Rational`](malachite_q::Rational) base, for computing $\log_b(1+x)$ of a
352/// [`Float`](super::Float) with an arbitrary rational base $b>1$.
353pub mod log_base_rational_base_1_plus_x;
354/// Functions for computing $\log_b x$ of a [`Rational`](malachite_q::Rational) $x$ with an
355/// arbitrary [`Float`](super::Float) base, returning a [`Float`](super::Float).
356pub mod log_base_rational_float_base;
357/// Functions for computing $\log_b x$ of a [`Rational`](malachite_q::Rational) $x$ with an
358/// arbitrary [`Rational`](malachite_q::Rational) base $b>1$, returning a [`Float`](super::Float).
359pub mod log_base_rational_rational_base;
360/// Multiplication of [`Float`](super::Float)s, and of [`Float`](super::Float)s with
361/// [`Rational`](malachite_q::Rational)s.
362pub mod mul;
363/// [`MulAddMul`](malachite_base::num::arithmetic::traits::MulAddMul) and
364/// [`MulAddMulAssign`](malachite_base::num::arithmetic::traits::MulAddMulAssign), traits for adding
365/// the products of two pairs of [`Float`](super::Float)s with a single rounding, and the associated
366/// precision- and rounding-mode-aware functions.
367pub mod mul_add_mul;
368/// [`MulSubMul`](malachite_base::num::arithmetic::traits::MulSubMul) and
369/// [`MulSubMulAssign`](malachite_base::num::arithmetic::traits::MulSubMulAssign), traits for
370/// subtracting the product of one pair of [`Float`](super::Float)s from the product of another pair
371/// with a single rounding, and the associated precision- and rounding-mode-aware functions.
372pub mod mul_sub_mul;
373/// Negation of [`Float`](super::Float)s.
374pub mod neg;
375/// [`positive_difference_prec_round`](super::Float::positive_difference_prec_round) and related
376/// functions, for computing positive differences of [`Float`](super::Float)s.
377pub mod positive_difference;
378/// Implementations of [`PowerOf2`](malachite_base::num::arithmetic::traits::PowerOf2), a trait for
379/// computing a power of 2.
380pub mod pow;
381/// An implementation of [`PowerOf2`](malachite_base::num::arithmetic::traits::PowerOf2) with a
382/// [`Float`](super::Float) exponent, computing $2^x$ for [`Float`](super::Float)s.
383pub mod power_of_10;
384pub mod power_of_10_x_minus_1;
385pub mod power_of_2;
386pub mod power_of_2_of_float;
387/// Implementations of [`PowerOf2XMinus1`](malachite_base::num::arithmetic::traits::PowerOf2XMinus1)
388/// and [`PowerOf2XMinus1Assign`](malachite_base::num::arithmetic::traits::PowerOf2XMinus1Assign),
389/// traits for computing $2^x-1$.
390pub mod power_of_2_x_minus_1;
391/// Correctly-rounded multiplication of any number of [`Float`](super::Float)s: functions computing
392/// a slice's product with a single rounding at the end, and the [`Product`](core::iter::Product)
393/// implementations built on them.
394pub mod product;
395/// Implementations of [`Reciprocal`](malachite_base::num::arithmetic::traits::Reciprocal) and
396/// [`ReciprocalAssign`](malachite_base::num::arithmetic::traits::ReciprocalAssign), traits for
397/// computing the reciprocal of a number.
398pub mod reciprocal;
399/// [`ReciprocalSqrt`](malachite_base::num::arithmetic::traits::ReciprocalSqrt) and
400/// [`ReciprocalSqrtAssign`](malachite_base::num::arithmetic::traits::ReciprocalSqrtAssign), traits
401/// for computing the reciprocal of the square root of [`Float`](super::Float)s.
402pub mod reciprocal_sqrt;
403/// [`rem_prec_round`](super::Float::rem_prec_round) and related functions, for computing
404/// floating-point remainders of [`Float`](super::Float)s.
405pub mod rem;
406/// [`root_u_prec_round`](super::Float::root_u_prec_round) and related functions, for computing
407/// roots of [`Float`](super::Float)s.
408pub mod root;
409pub(crate) mod round_near_x;
410pub mod round_to_integer;
411/// Implementations of [`Sec`](malachite_base::num::arithmetic::traits::Sec) and
412/// [`SecAssign`](malachite_base::num::arithmetic::traits::SecAssign), traits for computing the
413/// secant of [`Float`](super::Float)s.
414pub mod sec;
415/// Implementations of [`Sech`](malachite_base::num::arithmetic::traits::Sech) and
416/// [`SechAssign`](malachite_base::num::arithmetic::traits::SechAssign), traits for computing the
417/// hyperbolic secant of [`Float`](super::Float)s.
418pub mod sech;
419/// Left-shifting a [`Float`](super::Float) (multiplying it by a power of 2).
420///
421/// # shl
422/// ```
423/// use malachite_base::num::basic::traits::{Infinity, Zero};
424/// use malachite_float::Float;
425///
426/// assert_eq!(Float::ZERO << 10, 0);
427/// assert_eq!(Float::INFINITY << 10, Float::INFINITY);
428/// assert_eq!(
429///     (Float::from(std::f64::consts::PI) << 10u8).to_string(),
430///     "3216.9908772759482"
431/// );
432/// assert_eq!(
433///     (Float::from(std::f64::consts::PI) << -10i8).to_string(),
434///     "0.0030679615757712823"
435/// );
436///
437/// assert_eq!(&Float::ZERO << 10, 0);
438/// assert_eq!(&Float::INFINITY << 10, Float::INFINITY);
439/// assert_eq!(
440///     (&Float::from(std::f64::consts::PI) << 10u8).to_string(),
441///     "3216.9908772759482"
442/// );
443/// assert_eq!(
444///     (&Float::from(std::f64::consts::PI) << -10i8).to_string(),
445///     "0.0030679615757712823"
446/// );
447/// ```
448///
449/// # shl_assign
450/// ```
451/// use malachite_base::num::basic::traits::{Infinity, Zero};
452/// use malachite_float::Float;
453///
454/// let mut x = Float::ZERO;
455/// x <<= 10;
456/// assert_eq!(x, 0);
457///
458/// let mut x = Float::INFINITY;
459/// x <<= 10;
460/// assert_eq!(x, Float::INFINITY);
461///
462/// let mut x = Float::from(std::f64::consts::PI);
463/// x <<= 10;
464/// assert_eq!(x.to_string(), "3216.9908772759482");
465///
466/// let mut x = Float::from(std::f64::consts::PI);
467/// x <<= -10;
468/// assert_eq!(x.to_string(), "0.0030679615757712823");
469/// ```
470pub mod shl;
471/// Implementations of [`ShlRound`](malachite_base::num::arithmetic::traits::ShlRound) and
472/// [`ShlRoundAssign`](malachite_base::num::arithmetic::traits::ShlRoundAssign), traits for
473/// multiplying a number by a power of 2 and rounding according to a specified
474/// [`RoundingMode`](malachite_base::rounding_modes::RoundingMode). For [`Float`](super::Float)s,
475/// rounding is only necessary in the cases of overflow and underflow.
476///
477/// # shl_prec_round
478/// ```
479/// use malachite_base::rounding_modes::RoundingMode::*;
480/// use malachite_float::Float;
481/// use std::cmp::Ordering::*;
482///
483/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round(10u8, 10, Nearest);
484/// assert_eq!(shifted.to_string(), "3216.0");
485/// assert_eq!(o, Less);
486///
487/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round(-10i8, 10, Nearest);
488/// assert_eq!(shifted.to_string(), "0.0030670");
489/// assert_eq!(o, Less);
490///
491/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round(u32::MAX, 10, Floor);
492/// assert_eq!(shifted.to_string(), "2.0965e323228496");
493/// assert_eq!(o, Less);
494///
495/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round(u32::MAX, 10, Ceiling);
496/// assert_eq!(shifted.to_string(), "Infinity");
497/// assert_eq!(o, Greater);
498///
499/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round_ref(10u8, 10, Nearest);
500/// assert_eq!(shifted.to_string(), "3216.0");
501/// assert_eq!(o, Less);
502///
503/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round_ref(-10i8, 10, Nearest);
504/// assert_eq!(shifted.to_string(), "0.0030670");
505/// assert_eq!(o, Less);
506///
507/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round_ref(u32::MAX, 10, Floor);
508/// assert_eq!(shifted.to_string(), "2.0965e323228496");
509/// assert_eq!(o, Less);
510///
511/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round_ref(u32::MAX, 10, Ceiling);
512/// assert_eq!(shifted.to_string(), "Infinity");
513/// assert_eq!(o, Greater);
514/// ```
515///
516/// # shl_prec_round_assign
517/// ```
518/// use malachite_base::rounding_modes::RoundingMode::*;
519/// use malachite_float::Float;
520/// use std::cmp::Ordering::*;
521///
522/// let mut x = Float::from(std::f64::consts::PI);
523/// assert_eq!(x.shl_prec_round_assign(10u8, 10, Nearest), Less);
524/// assert_eq!(x.to_string(), "3216.0");
525///
526/// let mut x = Float::from(std::f64::consts::PI);
527/// assert_eq!(x.shl_prec_round_assign(-10i8, 10, Nearest), Less);
528/// assert_eq!(x.to_string(), "0.0030670");
529///
530/// let mut x = Float::from(std::f64::consts::PI);
531/// assert_eq!(x.shl_prec_round_assign(u32::MAX, 10, Floor), Less);
532/// assert_eq!(x.to_string(), "2.0965e323228496");
533///
534/// let mut x = Float::from(std::f64::consts::PI);
535/// assert_eq!(x.shl_prec_round_assign(u32::MAX, 10, Ceiling), Greater);
536/// assert_eq!(x.to_string(), "Infinity");
537/// ```
538///
539/// # shl_prec
540/// ```
541/// use malachite_float::Float;
542/// use std::cmp::Ordering::*;
543///
544/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec(10u8, 10);
545/// assert_eq!(shifted.to_string(), "3216.0");
546/// assert_eq!(o, Less);
547///
548/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec(-10i8, 10);
549/// assert_eq!(shifted.to_string(), "0.0030670");
550/// assert_eq!(o, Less);
551///
552/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec(u32::MAX, 10);
553/// assert_eq!(shifted.to_string(), "Infinity");
554/// assert_eq!(o, Greater);
555///
556/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_ref(10u8, 10);
557/// assert_eq!(shifted.to_string(), "3216.0");
558/// assert_eq!(o, Less);
559///
560/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_ref(-10i8, 10);
561/// assert_eq!(shifted.to_string(), "0.0030670");
562/// assert_eq!(o, Less);
563///
564/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_ref(u32::MAX, 10);
565/// assert_eq!(shifted.to_string(), "Infinity");
566/// assert_eq!(o, Greater);
567/// ```
568///
569/// # shl_prec_assign
570/// ```
571/// use malachite_float::Float;
572/// use std::cmp::Ordering::*;
573///
574/// let mut x = Float::from(std::f64::consts::PI);
575/// assert_eq!(x.shl_prec_assign(10u8, 10), Less);
576/// assert_eq!(x.to_string(), "3216.0");
577///
578/// let mut x = Float::from(std::f64::consts::PI);
579/// assert_eq!(x.shl_prec_assign(-10i8, 10), Less);
580/// assert_eq!(x.to_string(), "0.0030670");
581///
582/// let mut x = Float::from(std::f64::consts::PI);
583/// assert_eq!(x.shl_prec_assign(u32::MAX, 10), Greater);
584/// assert_eq!(x.to_string(), "Infinity");
585/// ```
586///
587/// # shl_round
588/// ```
589/// use malachite_base::num::arithmetic::traits::ShlRound;
590/// use malachite_base::rounding_modes::RoundingMode::*;
591/// use malachite_float::Float;
592/// use std::cmp::Ordering::*;
593///
594/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_round(10u8, Nearest);
595/// assert_eq!(shifted.to_string(), "3216.9908772759482");
596/// assert_eq!(o, Equal);
597///
598/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_round(-10i8, Nearest);
599/// assert_eq!(shifted.to_string(), "0.0030679615757712823");
600/// assert_eq!(o, Equal);
601///
602/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_round(u32::MAX, Floor);
603/// assert_eq!(shifted.to_string(), "2.0985787164673858e323228496");
604/// assert_eq!(o, Less);
605///
606/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_round(u32::MAX, Ceiling);
607/// assert_eq!(shifted.to_string(), "Infinity");
608/// assert_eq!(o, Greater);
609///
610/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shl_round(10u8, Nearest);
611/// assert_eq!(shifted.to_string(), "3216.9908772759482");
612/// assert_eq!(o, Equal);
613///
614/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shl_round(-10i8, Nearest);
615/// assert_eq!(shifted.to_string(), "0.0030679615757712823");
616/// assert_eq!(o, Equal);
617///
618/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shl_round(u32::MAX, Floor);
619/// assert_eq!(shifted.to_string(), "2.0985787164673858e323228496");
620/// assert_eq!(o, Less);
621///
622/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shl_round(u32::MAX, Ceiling);
623/// assert_eq!(shifted.to_string(), "Infinity");
624/// assert_eq!(o, Greater);
625/// ```
626///
627/// # shl_round_assign
628/// ```
629/// use malachite_base::num::arithmetic::traits::ShlRoundAssign;
630/// use malachite_base::rounding_modes::RoundingMode::*;
631/// use malachite_float::Float;
632/// use std::cmp::Ordering::*;
633///
634/// let mut x = Float::from(std::f64::consts::PI);
635/// assert_eq!(x.shl_round_assign(10u8, Nearest), Equal);
636/// assert_eq!(x.to_string(), "3216.9908772759482");
637///
638/// let mut x = Float::from(std::f64::consts::PI);
639/// assert_eq!(x.shl_round_assign(-10i8, Nearest), Equal);
640/// assert_eq!(x.to_string(), "0.0030679615757712823");
641///
642/// let mut x = Float::from(std::f64::consts::PI);
643/// assert_eq!(x.shl_round_assign(u32::MAX, Floor), Less);
644/// assert_eq!(x.to_string(), "2.0985787164673858e323228496");
645///
646/// let mut x = Float::from(std::f64::consts::PI);
647/// assert_eq!(x.shl_round_assign(u32::MAX, Ceiling), Greater);
648/// assert_eq!(x.to_string(), "Infinity");
649/// ```
650pub mod shl_round;
651/// Right-shifting a [`Float`](super::Float) (dividing it by a power of 2).
652///
653/// # shr
654/// ```
655/// use malachite_base::num::basic::traits::{Infinity, Zero};
656/// use malachite_float::Float;
657///
658/// assert_eq!(Float::ZERO >> 10, 0);
659/// assert_eq!(Float::INFINITY >> 10, Float::INFINITY);
660/// assert_eq!(
661///     (Float::from(std::f64::consts::PI) >> 10u8).to_string(),
662///     "0.0030679615757712823"
663/// );
664/// assert_eq!(
665///     (Float::from(std::f64::consts::PI) >> -10i8).to_string(),
666///     "3216.9908772759482"
667/// );
668///
669/// assert_eq!(&Float::ZERO >> 10, 0);
670/// assert_eq!(&Float::INFINITY >> 10, Float::INFINITY);
671/// assert_eq!(
672///     (&Float::from(std::f64::consts::PI) >> 10u8).to_string(),
673///     "0.0030679615757712823"
674/// );
675/// assert_eq!(
676///     (&Float::from(std::f64::consts::PI) >> -10i8).to_string(),
677///     "3216.9908772759482"
678/// );
679/// ```
680///
681/// # shr_assign
682/// ```
683/// use malachite_base::num::basic::traits::{Infinity, Zero};
684/// use malachite_float::Float;
685///
686/// let mut x = Float::ZERO;
687/// x >>= 10;
688/// assert_eq!(x, 0);
689///
690/// let mut x = Float::INFINITY;
691/// x >>= 10;
692/// assert_eq!(x, Float::INFINITY);
693///
694/// let mut x = Float::from(std::f64::consts::PI);
695/// x >>= 10;
696/// assert_eq!(x.to_string(), "0.0030679615757712823");
697///
698/// let mut x = Float::from(std::f64::consts::PI);
699/// x >>= -10;
700/// assert_eq!(x.to_string(), "3216.9908772759482");
701/// ```
702pub mod shr;
703/// Implementations of [`ShlRound`](malachite_base::num::arithmetic::traits::ShrRound) and
704/// [`ShrRoundAssign`](malachite_base::num::arithmetic::traits::ShrRoundAssign), traits for dividing
705/// a number by a power of 2 and rounding according to a specified
706/// [`RoundingMode`](malachite_base::rounding_modes::RoundingMode). For [`Float`](super::Float)s,
707/// rounding is only necessary in the cases of overflow and underflow.
708///
709/// # shr_prec_round
710/// ```
711/// use malachite_base::rounding_modes::RoundingMode::*;
712/// use malachite_float::Float;
713/// use std::cmp::Ordering::*;
714///
715/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round(10u8, 10, Nearest);
716/// assert_eq!(shifted.to_string(), "0.0030670");
717/// assert_eq!(o, Less);
718///
719/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round(-10i8, 10, Nearest);
720/// assert_eq!(shifted.to_string(), "3216.0");
721/// assert_eq!(o, Less);
722///
723/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round(u32::MAX, 10, Floor);
724/// assert_eq!(shifted.to_string(), "0.0");
725/// assert_eq!(o, Less);
726///
727/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round(u32::MAX, 10, Ceiling);
728/// assert_eq!(shifted.to_string(), "2.3826e-323228497");
729/// assert_eq!(o, Greater);
730///
731/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round_ref(10u8, 10, Nearest);
732/// assert_eq!(shifted.to_string(), "0.0030670");
733/// assert_eq!(o, Less);
734///
735/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round_ref(-10i8, 10, Nearest);
736/// assert_eq!(shifted.to_string(), "3216.0");
737/// assert_eq!(o, Less);
738///
739/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round_ref(u32::MAX, 10, Floor);
740/// assert_eq!(shifted.to_string(), "0.0");
741/// assert_eq!(o, Less);
742///
743/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round_ref(u32::MAX, 10, Ceiling);
744/// assert_eq!(shifted.to_string(), "2.3826e-323228497");
745/// assert_eq!(o, Greater);
746/// ```
747///
748/// # shr_prec_round_assign
749/// ```
750/// use malachite_base::rounding_modes::RoundingMode::*;
751/// use malachite_float::Float;
752/// use std::cmp::Ordering::*;
753///
754/// let mut x = Float::from(std::f64::consts::PI);
755/// assert_eq!(x.shr_prec_round_assign(10u8, 10, Nearest), Less);
756/// assert_eq!(x.to_string(), "0.0030670");
757///
758/// let mut x = Float::from(std::f64::consts::PI);
759/// assert_eq!(x.shr_prec_round_assign(-10i8, 10, Nearest), Less);
760/// assert_eq!(x.to_string(), "3216.0");
761///
762/// let mut x = Float::from(std::f64::consts::PI);
763/// assert_eq!(x.shr_prec_round_assign(u32::MAX, 10, Floor), Less);
764/// assert_eq!(x.to_string(), "0.0");
765///
766/// let mut x = Float::from(std::f64::consts::PI);
767/// assert_eq!(x.shr_prec_round_assign(u32::MAX, 10, Ceiling), Greater);
768/// assert_eq!(x.to_string(), "2.3826e-323228497");
769/// ```
770///
771/// # shr_prec
772/// ```
773/// use malachite_float::Float;
774/// use std::cmp::Ordering::*;
775///
776/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec(10u8, 10);
777/// assert_eq!(shifted.to_string(), "0.0030670");
778/// assert_eq!(o, Less);
779///
780/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec(-10i8, 10);
781/// assert_eq!(shifted.to_string(), "3216.0");
782/// assert_eq!(o, Less);
783///
784/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec(u32::MAX, 10);
785/// assert_eq!(shifted.to_string(), "0.0");
786/// assert_eq!(o, Less);
787///
788/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_ref(10u8, 10);
789/// assert_eq!(shifted.to_string(), "0.0030670");
790/// assert_eq!(o, Less);
791///
792/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_ref(-10i8, 10);
793/// assert_eq!(shifted.to_string(), "3216.0");
794/// assert_eq!(o, Less);
795///
796/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_ref(u32::MAX, 10);
797/// assert_eq!(shifted.to_string(), "0.0");
798/// assert_eq!(o, Less);
799/// ```
800///
801/// # shr_prec_assign
802/// ```
803/// use malachite_float::Float;
804/// use std::cmp::Ordering::*;
805///
806/// let mut x = Float::from(std::f64::consts::PI);
807/// assert_eq!(x.shr_prec_assign(10u8, 10), Less);
808/// assert_eq!(x.to_string(), "0.0030670");
809///
810/// let mut x = Float::from(std::f64::consts::PI);
811/// assert_eq!(x.shr_prec_assign(-10i8, 10), Less);
812/// assert_eq!(x.to_string(), "3216.0");
813///
814/// let mut x = Float::from(std::f64::consts::PI);
815/// assert_eq!(x.shr_prec_assign(u32::MAX, 10), Less);
816/// assert_eq!(x.to_string(), "0.0");
817/// ```
818///
819/// # shr_round
820/// ```
821/// use malachite_base::num::arithmetic::traits::ShrRound;
822/// use malachite_base::rounding_modes::RoundingMode::*;
823/// use malachite_float::Float;
824/// use std::cmp::Ordering::*;
825///
826/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_round(10u8, Nearest);
827/// assert_eq!(shifted.to_string(), "0.0030679615757712823");
828/// assert_eq!(o, Equal);
829///
830/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_round(-10i8, Nearest);
831/// assert_eq!(shifted.to_string(), "3216.9908772759482");
832/// assert_eq!(o, Equal);
833///
834/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_round(u32::MAX, Floor);
835/// assert_eq!(shifted.to_string(), "0.0");
836/// assert_eq!(o, Less);
837///
838/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_round(u32::MAX, Ceiling);
839/// assert_eq!(shifted.to_string(), "2.3825649048879511e-323228497");
840/// assert_eq!(o, Greater);
841///
842/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shr_round(10u8, Nearest);
843/// assert_eq!(shifted.to_string(), "0.0030679615757712823");
844/// assert_eq!(o, Equal);
845///
846/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shr_round(-10i8, Nearest);
847/// assert_eq!(shifted.to_string(), "3216.9908772759482");
848/// assert_eq!(o, Equal);
849///
850/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shr_round(u32::MAX, Floor);
851/// assert_eq!(shifted.to_string(), "0.0");
852/// assert_eq!(o, Less);
853///
854/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shr_round(u32::MAX, Ceiling);
855/// assert_eq!(shifted.to_string(), "2.3825649048879511e-323228497");
856/// assert_eq!(o, Greater);
857/// ```
858///
859/// # shr_round_assign
860/// ```
861/// use malachite_base::num::arithmetic::traits::ShrRoundAssign;
862/// use malachite_base::rounding_modes::RoundingMode::*;
863/// use malachite_float::Float;
864/// use std::cmp::Ordering::*;
865///
866/// let mut x = Float::from(std::f64::consts::PI);
867/// assert_eq!(x.shr_round_assign(10u8, Nearest), Equal);
868/// assert_eq!(x.to_string(), "0.0030679615757712823");
869///
870/// let mut x = Float::from(std::f64::consts::PI);
871/// assert_eq!(x.shr_round_assign(-10i8, Nearest), Equal);
872/// assert_eq!(x.to_string(), "3216.9908772759482");
873///
874/// let mut x = Float::from(std::f64::consts::PI);
875/// assert_eq!(x.shr_round_assign(u32::MAX, Floor), Less);
876/// assert_eq!(x.to_string(), "0.0");
877///
878/// let mut x = Float::from(std::f64::consts::PI);
879/// assert_eq!(x.shr_round_assign(u32::MAX, Ceiling), Greater);
880/// assert_eq!(x.to_string(), "2.3825649048879511e-323228497");
881/// ```
882pub mod shr_round;
883/// An implementation of [`Sign`](malachite_base::num::arithmetic::traits::Sign), a trait for
884/// determining the sign of a number.
885pub mod sign;
886/// Implementations of [`Sin`](malachite_base::num::arithmetic::traits::Sin) and
887/// [`SinAssign`](malachite_base::num::arithmetic::traits::SinAssign), traits for computing the sine
888/// of [`Float`](super::Float)s.
889pub mod sin;
890/// Implementations of [`SinCos`](malachite_base::num::arithmetic::traits::SinCos) and
891/// [`SinCosAssign`](malachite_base::num::arithmetic::traits::SinCosAssign), traits for computing
892/// the sine and cosine of [`Float`](super::Float)s together.
893pub mod sin_cos;
894/// Implementations of [`Sinh`](malachite_base::num::arithmetic::traits::Sinh) and
895/// [`SinhAssign`](malachite_base::num::arithmetic::traits::SinhAssign), traits for computing the
896/// hyperbolic sine of [`Float`](super::Float)s.
897pub mod sinh;
898/// Implementations of [`SinhCosh`](malachite_base::num::arithmetic::traits::SinhCosh) and
899/// [`SinhCoshAssign`](malachite_base::num::arithmetic::traits::SinhCoshAssign), traits for
900/// computing the hyperbolic sine and cosine of [`Float`](super::Float)s together.
901pub mod sinh_cosh;
902/// [`Sqrt`](malachite_base::num::arithmetic::traits::Sqrt) and
903/// [`SqrtAssign`](malachite_base::num::arithmetic::traits::SqrtAssign), traits for computing the
904/// square root of [`Float`](super::Float)s.
905pub mod sqrt;
906/// Squaring of [`Float`](super::Float)s.
907pub mod square;
908/// Subtraction of [`Float`](super::Float)s, of [`Float`](super::Float)s by
909/// [`Rational`](malachite_q::Rational)s, and of [`Rational`](malachite_q::Rational)s by
910/// [`Float`](super::Float)s.
911pub mod sub;
912/// [`SubMul`](malachite_base::num::arithmetic::traits::SubMul) and
913/// [`SubMulAssign`](malachite_base::num::arithmetic::traits::SubMulAssign), traits for subtracting
914/// the product of two [`Float`](super::Float)s — or of a [`Float`](super::Float) and a
915/// [`Rational`](malachite_q::Rational) — from another [`Float`](super::Float) with a single
916/// rounding (fused multiply-subtract), and the associated precision- and rounding-mode-aware
917/// functions.
918pub mod sub_mul;
919/// Correctly-rounded summation of any number of [`Float`](super::Float)s: functions computing a
920/// slice's sum with a single rounding at the end, and the [`Sum`](core::iter::Sum) implementations
921/// built on them.
922pub mod sum;
923pub mod tan;
924/// Implementations of [`Tanh`](malachite_base::num::arithmetic::traits::Tanh) and
925/// [`TanhAssign`](malachite_base::num::arithmetic::traits::TanhAssign), traits for computing the
926/// hyperbolic tangent of [`Float`](super::Float)s.
927pub mod tanh;