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/// [`CanonicalizeUnit`](malachite_base::num::arithmetic::traits::CanonicalizeUnit) and
204/// [`CanonicalizeUnitAssign`](malachite_base::num::arithmetic::traits::CanonicalizeUnitAssign),
205/// traits for bringing a number into canonical unit form.
206pub mod canonicalize_unit;
207/// Cube root of [`Float`](super::Float)s and of [`Rational`](malachite_q::Rational)s.
208pub mod cbrt;
209/// [`Compound`](malachite_base::num::arithmetic::traits::Compound) and
210/// [`CompoundAssign`](malachite_base::num::arithmetic::traits::CompoundAssign), traits for
211/// computing the compound function $(1+x)^n$ for [`Float`](super::Float)s.
212pub mod compound;
213/// Implementations of [`Conjugate`](malachite_base::num::arithmetic::traits::Conjugate) and
214/// [`ConjugateAssign`](malachite_base::num::arithmetic::traits::ConjugateAssign), traits for
215/// computing the complex conjugate of a number. A real number is its own conjugate.
216pub mod conjugate;
217/// Implementations of [`Cos`](malachite_base::num::arithmetic::traits::Cos) and
218/// [`CosAssign`](malachite_base::num::arithmetic::traits::CosAssign), traits for computing the
219/// cosine of [`Float`](super::Float)s.
220pub mod cos;
221/// Implementations of [`Cosh`](malachite_base::num::arithmetic::traits::Cosh) and
222/// [`CoshAssign`](malachite_base::num::arithmetic::traits::CoshAssign), traits for computing the
223/// hyperbolic cosine of [`Float`](super::Float)s.
224pub mod cosh;
225/// Implementations of [`Cot`](malachite_base::num::arithmetic::traits::Cot) and
226/// [`CotAssign`](malachite_base::num::arithmetic::traits::CotAssign), traits for computing the
227/// cotangent of [`Float`](super::Float)s.
228pub mod cot;
229/// Implementations of [`Coth`](malachite_base::num::arithmetic::traits::Coth) and
230/// [`CothAssign`](malachite_base::num::arithmetic::traits::CothAssign), traits for computing the
231/// hyperbolic cotangent of [`Float`](super::Float)s.
232pub mod coth;
233/// Implementations of [`Csc`](malachite_base::num::arithmetic::traits::Csc) and
234/// [`CscAssign`](malachite_base::num::arithmetic::traits::CscAssign), traits for computing the
235/// cosecant of [`Float`](super::Float)s.
236pub mod csc;
237/// Implementations of [`Csch`](malachite_base::num::arithmetic::traits::Csch) and
238/// [`CschAssign`](malachite_base::num::arithmetic::traits::CschAssign), traits for computing the
239/// hyperbolic cosecant of [`Float`](super::Float)s.
240pub mod csch;
241/// Division of [`Float`](super::Float)s, of [`Float`](super::Float)s by
242/// [`Rational`](malachite_q::Rational)s, and of [`Rational`](malachite_q::Rational)s by
243/// [`Float`](super::Float)s.
244pub mod div;
245/// Correctly-rounded dot products of [`Float`](super::Float) slices, with the products computed
246/// exactly and a single rounding at the end, so that intermediate overflow and underflow cannot
247/// occur.
248pub mod dot;
249/// [`Exp`](malachite_base::num::arithmetic::traits::Exp) and
250/// [`ExpAssign`](malachite_base::num::arithmetic::traits::ExpAssign), traits for computing $e^x$
251/// for [`Float`](super::Float)s.
252pub mod exp;
253/// [`ExpXMinus1`](malachite_base::num::arithmetic::traits::ExpXMinus1) and
254/// [`ExpXMinus1Assign`](malachite_base::num::arithmetic::traits::ExpXMinus1Assign), traits for
255/// computing $e^x-1$ for [`Float`](super::Float)s.
256pub mod exp_x_minus_1;
257/// [`factorial_prec_round`](super::Float::factorial_prec_round) and
258/// [`factorial_prec`](super::Float::factorial_prec), for computing correctly-rounded factorials.
259pub mod factorial;
260/// Fractional parts of [`Float`](super::Float)s: the `fractional_part` and
261/// `integer_and_fractional_parts` families.
262pub mod fractional_part;
263/// [`Hypot`](malachite_base::num::arithmetic::traits::Hypot) and
264/// [`HypotAssign`](malachite_base::num::arithmetic::traits::HypotAssign), traits for computing the
265/// hypotenuse of two numbers, $\sqrt{x^2+y^2}$.
266///
267/// # hypot
268/// ```
269/// use core::f64::consts::{E, PI};
270/// use malachite_base::num::arithmetic::traits::Hypot;
271/// use malachite_float::Float;
272///
273/// assert_eq!(
274///     Float::from(PI).hypot(Float::from(E)).to_string(),
275///     "4.1543544023133130"
276/// );
277/// ```
278pub mod hypot;
279/// An implementation of [`IsPowerOf2`](malachite_base::num::arithmetic::traits::IsPowerOf2), a
280/// trait for determining whether a number is an integer power of 2.
281pub mod is_power_of_2;
282/// An implementation of [`IsUnit`](malachite_base::num::arithmetic::traits::IsUnit), a trait for
283/// determining whether a number is a unit of its ring.
284pub mod is_unit;
285/// [`Ln`](malachite_base::num::arithmetic::traits::Ln) and
286/// [`LnAssign`](malachite_base::num::arithmetic::traits::LnAssign), traits for computing the
287/// natural logarithm of [`Float`](super::Float)s.
288pub mod ln;
289/// [`Ln1PlusX`](malachite_base::num::arithmetic::traits::Ln1PlusX) and
290/// [`Ln1PlusXAssign`](malachite_base::num::arithmetic::traits::Ln1PlusXAssign), traits for
291/// computing $\ln(1+x)$ for [`Float`](super::Float)s.
292pub mod ln_1_plus_x;
293/// [`LogBase`](malachite_base::num::arithmetic::traits::LogBase) and
294/// [`LogBaseAssign`](malachite_base::num::arithmetic::traits::LogBaseAssign), traits for computing
295/// the base-$b$ logarithm of [`Float`](super::Float)s for an arbitrary integer base $b>1$.
296pub mod log_base;
297/// [`LogBase10`](malachite_base::num::arithmetic::traits::LogBase10) and
298/// [`LogBase10Assign`](malachite_base::num::arithmetic::traits::LogBase10Assign), traits for
299/// computing the base-10 logarithm of [`Float`](super::Float)s.
300pub mod log_base_10;
301/// [`LogBase10Of1PlusX`](malachite_base::num::arithmetic::traits::LogBase10Of1PlusX) and
302/// [`LogBase10Of1PlusXAssign`](malachite_base::num::arithmetic::traits::LogBase10Of1PlusXAssign),
303/// traits for computing $\log_{10}(1+x)$ of [`Float`](super::Float)s.
304pub mod log_base_10_1_plus_x;
305/// [`LogBaseOf1PlusX`](malachite_base::num::arithmetic::traits::LogBaseOf1PlusX) and
306/// [`LogBaseOf1PlusXAssign`](malachite_base::num::arithmetic::traits::LogBaseOf1PlusXAssign),
307/// traits for computing $\log_b(1+x)$ of [`Float`](super::Float)s for an arbitrary integer base
308/// $b>1$.
309pub mod log_base_1_plus_x;
310/// [`LogBase2`](malachite_base::num::arithmetic::traits::LogBase2) and
311/// [`LogBase2Assign`](malachite_base::num::arithmetic::traits::LogBase2Assign), traits for
312/// computing the base-2 logarithm of [`Float`](super::Float)s.
313pub mod log_base_2;
314/// [`LogBase2Of1PlusX`](malachite_base::num::arithmetic::traits::LogBase2Of1PlusX) and
315/// [`LogBase2Of1PlusXAssign`](malachite_base::num::arithmetic::traits::LogBase2Of1PlusXAssign),
316/// traits for computing $\log_2(1+x)$ for [`Float`](super::Float)s.
317pub mod log_base_2_1_plus_x;
318/// [`LogBase`](malachite_base::num::arithmetic::traits::LogBase) and
319/// [`LogBaseAssign`](malachite_base::num::arithmetic::traits::LogBaseAssign), implemented for a
320/// [`Float`](super::Float) base, for computing $\log_b x$ of a [`Float`](super::Float) with an
321/// arbitrary [`Float`](super::Float) base.
322pub mod log_base_float_base;
323/// [`LogBaseOf1PlusX`](malachite_base::num::arithmetic::traits::LogBaseOf1PlusX) and
324/// [`LogBaseOf1PlusXAssign`](malachite_base::num::arithmetic::traits::LogBaseOf1PlusXAssign),
325/// implemented for a [`Float`](super::Float) base, for computing $\log_b(1+x)$ of a
326/// [`Float`](super::Float) with an arbitrary [`Float`](super::Float) base.
327pub mod log_base_float_base_1_plus_x;
328/// [`LogBasePowerOf2`](malachite_base::num::arithmetic::traits::LogBasePowerOf2) and
329/// [`LogBasePowerOf2Assign`](malachite_base::num::arithmetic::traits::LogBasePowerOf2Assign),
330/// traits for computing $\log_{2^k} x$ for [`Float`](super::Float)s.
331pub mod log_base_power_of_2;
332/// [`LogBasePowerOf2Of1PlusX`](malachite_base::num::arithmetic::traits::LogBasePowerOf2Of1PlusX)
333/// and
334/// [`LogBasePowerOf2Of1PlusXAssign`](malachite_base::num::arithmetic::traits::LogBasePowerOf2Of1PlusXAssign),
335/// traits for computing $\log_{2^k}(1+x)$ for [`Float`](super::Float)s.
336#[cfg_attr(dylint_lib = "malachite_lints", expect(long_lines))]
337pub mod log_base_power_of_2_1_plus_x;
338/// [`LogBase`](malachite_base::num::arithmetic::traits::LogBase) and
339/// [`LogBaseAssign`](malachite_base::num::arithmetic::traits::LogBaseAssign), implemented for a
340/// [`Rational`](malachite_q::Rational) base, for computing $\log_b x$ of a [`Float`](super::Float)
341/// with an arbitrary rational base $b>1$.
342pub mod log_base_rational_base;
343/// [`LogBaseOf1PlusX`](malachite_base::num::arithmetic::traits::LogBaseOf1PlusX) and
344/// [`LogBaseOf1PlusXAssign`](malachite_base::num::arithmetic::traits::LogBaseOf1PlusXAssign),
345/// implemented for a [`Rational`](malachite_q::Rational) base, for computing $\log_b(1+x)$ of a
346/// [`Float`](super::Float) with an arbitrary rational base $b>1$.
347pub mod log_base_rational_base_1_plus_x;
348/// Functions for computing $\log_b x$ of a [`Rational`](malachite_q::Rational) $x$ with an
349/// arbitrary [`Float`](super::Float) base, returning a [`Float`](super::Float).
350pub mod log_base_rational_float_base;
351/// Functions for computing $\log_b x$ of a [`Rational`](malachite_q::Rational) $x$ with an
352/// arbitrary [`Rational`](malachite_q::Rational) base $b>1$, returning a [`Float`](super::Float).
353pub mod log_base_rational_rational_base;
354/// Multiplication of [`Float`](super::Float)s, and of [`Float`](super::Float)s with
355/// [`Rational`](malachite_q::Rational)s.
356pub mod mul;
357/// [`MulAddMul`](malachite_base::num::arithmetic::traits::MulAddMul) and
358/// [`MulAddMulAssign`](malachite_base::num::arithmetic::traits::MulAddMulAssign), traits for adding
359/// the products of two pairs of [`Float`](super::Float)s with a single rounding, and the associated
360/// precision- and rounding-mode-aware functions.
361pub mod mul_add_mul;
362/// [`MulSubMul`](malachite_base::num::arithmetic::traits::MulSubMul) and
363/// [`MulSubMulAssign`](malachite_base::num::arithmetic::traits::MulSubMulAssign), traits for
364/// subtracting the product of one pair of [`Float`](super::Float)s from the product of another pair
365/// with a single rounding, and the associated precision- and rounding-mode-aware functions.
366pub mod mul_sub_mul;
367/// Negation of [`Float`](super::Float)s.
368pub mod neg;
369/// [`positive_difference_prec_round`](super::Float::positive_difference_prec_round) and related
370/// functions, for computing positive differences of [`Float`](super::Float)s.
371pub mod positive_difference;
372/// Implementations of [`PowerOf2`](malachite_base::num::arithmetic::traits::PowerOf2), a trait for
373/// computing a power of 2.
374pub mod pow;
375/// An implementation of [`PowerOf2`](malachite_base::num::arithmetic::traits::PowerOf2) with a
376/// [`Float`](super::Float) exponent, computing $2^x$ for [`Float`](super::Float)s.
377pub mod power_of_10;
378pub mod power_of_10_x_minus_1;
379pub mod power_of_2;
380pub mod power_of_2_of_float;
381/// Implementations of [`PowerOf2XMinus1`](malachite_base::num::arithmetic::traits::PowerOf2XMinus1)
382/// and [`PowerOf2XMinus1Assign`](malachite_base::num::arithmetic::traits::PowerOf2XMinus1Assign),
383/// traits for computing $2^x-1$.
384pub mod power_of_2_x_minus_1;
385/// Correctly-rounded multiplication of any number of [`Float`](super::Float)s: functions computing
386/// a slice's product with a single rounding at the end, and the [`Product`](core::iter::Product)
387/// implementations built on them.
388pub mod product;
389/// Implementations of [`Reciprocal`](malachite_base::num::arithmetic::traits::Reciprocal) and
390/// [`ReciprocalAssign`](malachite_base::num::arithmetic::traits::ReciprocalAssign), traits for
391/// computing the reciprocal of a number.
392pub mod reciprocal;
393/// [`ReciprocalSqrt`](malachite_base::num::arithmetic::traits::ReciprocalSqrt) and
394/// [`ReciprocalSqrtAssign`](malachite_base::num::arithmetic::traits::ReciprocalSqrtAssign), traits
395/// for computing the reciprocal of the square root of [`Float`](super::Float)s.
396pub mod reciprocal_sqrt;
397/// [`rem_prec_round`](super::Float::rem_prec_round) and related functions, for computing
398/// floating-point remainders of [`Float`](super::Float)s.
399pub mod rem;
400/// [`root_u_prec_round`](super::Float::root_u_prec_round) and related functions, for computing
401/// roots of [`Float`](super::Float)s.
402pub mod root;
403pub(crate) mod round_near_x;
404pub mod round_to_integer;
405/// Implementations of [`Sec`](malachite_base::num::arithmetic::traits::Sec) and
406/// [`SecAssign`](malachite_base::num::arithmetic::traits::SecAssign), traits for computing the
407/// secant of [`Float`](super::Float)s.
408pub mod sec;
409/// Implementations of [`Sech`](malachite_base::num::arithmetic::traits::Sech) and
410/// [`SechAssign`](malachite_base::num::arithmetic::traits::SechAssign), traits for computing the
411/// hyperbolic secant of [`Float`](super::Float)s.
412pub mod sech;
413/// Left-shifting a [`Float`](super::Float) (multiplying it by a power of 2).
414///
415/// # shl
416/// ```
417/// use malachite_base::num::basic::traits::{Infinity, Zero};
418/// use malachite_float::Float;
419///
420/// assert_eq!(Float::ZERO << 10, 0);
421/// assert_eq!(Float::INFINITY << 10, Float::INFINITY);
422/// assert_eq!(
423///     (Float::from(std::f64::consts::PI) << 10u8).to_string(),
424///     "3216.9908772759482"
425/// );
426/// assert_eq!(
427///     (Float::from(std::f64::consts::PI) << -10i8).to_string(),
428///     "0.0030679615757712823"
429/// );
430///
431/// assert_eq!(&Float::ZERO << 10, 0);
432/// assert_eq!(&Float::INFINITY << 10, Float::INFINITY);
433/// assert_eq!(
434///     (&Float::from(std::f64::consts::PI) << 10u8).to_string(),
435///     "3216.9908772759482"
436/// );
437/// assert_eq!(
438///     (&Float::from(std::f64::consts::PI) << -10i8).to_string(),
439///     "0.0030679615757712823"
440/// );
441/// ```
442///
443/// # shl_assign
444/// ```
445/// use malachite_base::num::basic::traits::{Infinity, Zero};
446/// use malachite_float::Float;
447///
448/// let mut x = Float::ZERO;
449/// x <<= 10;
450/// assert_eq!(x, 0);
451///
452/// let mut x = Float::INFINITY;
453/// x <<= 10;
454/// assert_eq!(x, Float::INFINITY);
455///
456/// let mut x = Float::from(std::f64::consts::PI);
457/// x <<= 10;
458/// assert_eq!(x.to_string(), "3216.9908772759482");
459///
460/// let mut x = Float::from(std::f64::consts::PI);
461/// x <<= -10;
462/// assert_eq!(x.to_string(), "0.0030679615757712823");
463/// ```
464pub mod shl;
465/// Implementations of [`ShlRound`](malachite_base::num::arithmetic::traits::ShlRound) and
466/// [`ShlRoundAssign`](malachite_base::num::arithmetic::traits::ShlRoundAssign), traits for
467/// multiplying a number by a power of 2 and rounding according to a specified
468/// [`RoundingMode`](malachite_base::rounding_modes::RoundingMode). For [`Float`](super::Float)s,
469/// rounding is only necessary in the cases of overflow and underflow.
470///
471/// # shl_prec_round
472/// ```
473/// use malachite_base::rounding_modes::RoundingMode::*;
474/// use malachite_float::Float;
475/// use std::cmp::Ordering::*;
476///
477/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round(10u8, 10, Nearest);
478/// assert_eq!(shifted.to_string(), "3216.0");
479/// assert_eq!(o, Less);
480///
481/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round(-10i8, 10, Nearest);
482/// assert_eq!(shifted.to_string(), "0.0030670");
483/// assert_eq!(o, Less);
484///
485/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round(u32::MAX, 10, Floor);
486/// assert_eq!(shifted.to_string(), "2.0965e323228496");
487/// assert_eq!(o, Less);
488///
489/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round(u32::MAX, 10, Ceiling);
490/// assert_eq!(shifted.to_string(), "Infinity");
491/// assert_eq!(o, Greater);
492///
493/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round_ref(10u8, 10, Nearest);
494/// assert_eq!(shifted.to_string(), "3216.0");
495/// assert_eq!(o, Less);
496///
497/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round_ref(-10i8, 10, Nearest);
498/// assert_eq!(shifted.to_string(), "0.0030670");
499/// assert_eq!(o, Less);
500///
501/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round_ref(u32::MAX, 10, Floor);
502/// assert_eq!(shifted.to_string(), "2.0965e323228496");
503/// assert_eq!(o, Less);
504///
505/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round_ref(u32::MAX, 10, Ceiling);
506/// assert_eq!(shifted.to_string(), "Infinity");
507/// assert_eq!(o, Greater);
508/// ```
509///
510/// # shl_prec_round_assign
511/// ```
512/// use malachite_base::rounding_modes::RoundingMode::*;
513/// use malachite_float::Float;
514/// use std::cmp::Ordering::*;
515///
516/// let mut x = Float::from(std::f64::consts::PI);
517/// assert_eq!(x.shl_prec_round_assign(10u8, 10, Nearest), Less);
518/// assert_eq!(x.to_string(), "3216.0");
519///
520/// let mut x = Float::from(std::f64::consts::PI);
521/// assert_eq!(x.shl_prec_round_assign(-10i8, 10, Nearest), Less);
522/// assert_eq!(x.to_string(), "0.0030670");
523///
524/// let mut x = Float::from(std::f64::consts::PI);
525/// assert_eq!(x.shl_prec_round_assign(u32::MAX, 10, Floor), Less);
526/// assert_eq!(x.to_string(), "2.0965e323228496");
527///
528/// let mut x = Float::from(std::f64::consts::PI);
529/// assert_eq!(x.shl_prec_round_assign(u32::MAX, 10, Ceiling), Greater);
530/// assert_eq!(x.to_string(), "Infinity");
531/// ```
532///
533/// # shl_prec
534/// ```
535/// use malachite_float::Float;
536/// use std::cmp::Ordering::*;
537///
538/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec(10u8, 10);
539/// assert_eq!(shifted.to_string(), "3216.0");
540/// assert_eq!(o, Less);
541///
542/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec(-10i8, 10);
543/// assert_eq!(shifted.to_string(), "0.0030670");
544/// assert_eq!(o, Less);
545///
546/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec(u32::MAX, 10);
547/// assert_eq!(shifted.to_string(), "Infinity");
548/// assert_eq!(o, Greater);
549///
550/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_ref(10u8, 10);
551/// assert_eq!(shifted.to_string(), "3216.0");
552/// assert_eq!(o, Less);
553///
554/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_ref(-10i8, 10);
555/// assert_eq!(shifted.to_string(), "0.0030670");
556/// assert_eq!(o, Less);
557///
558/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_ref(u32::MAX, 10);
559/// assert_eq!(shifted.to_string(), "Infinity");
560/// assert_eq!(o, Greater);
561/// ```
562///
563/// # shl_prec_assign
564/// ```
565/// use malachite_float::Float;
566/// use std::cmp::Ordering::*;
567///
568/// let mut x = Float::from(std::f64::consts::PI);
569/// assert_eq!(x.shl_prec_assign(10u8, 10), Less);
570/// assert_eq!(x.to_string(), "3216.0");
571///
572/// let mut x = Float::from(std::f64::consts::PI);
573/// assert_eq!(x.shl_prec_assign(-10i8, 10), Less);
574/// assert_eq!(x.to_string(), "0.0030670");
575///
576/// let mut x = Float::from(std::f64::consts::PI);
577/// assert_eq!(x.shl_prec_assign(u32::MAX, 10), Greater);
578/// assert_eq!(x.to_string(), "Infinity");
579/// ```
580///
581/// # shl_round
582/// ```
583/// use malachite_base::num::arithmetic::traits::ShlRound;
584/// use malachite_base::rounding_modes::RoundingMode::*;
585/// use malachite_float::Float;
586/// use std::cmp::Ordering::*;
587///
588/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_round(10u8, Nearest);
589/// assert_eq!(shifted.to_string(), "3216.9908772759482");
590/// assert_eq!(o, Equal);
591///
592/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_round(-10i8, Nearest);
593/// assert_eq!(shifted.to_string(), "0.0030679615757712823");
594/// assert_eq!(o, Equal);
595///
596/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_round(u32::MAX, Floor);
597/// assert_eq!(shifted.to_string(), "2.0985787164673858e323228496");
598/// assert_eq!(o, Less);
599///
600/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_round(u32::MAX, Ceiling);
601/// assert_eq!(shifted.to_string(), "Infinity");
602/// assert_eq!(o, Greater);
603///
604/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shl_round(10u8, Nearest);
605/// assert_eq!(shifted.to_string(), "3216.9908772759482");
606/// assert_eq!(o, Equal);
607///
608/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shl_round(-10i8, Nearest);
609/// assert_eq!(shifted.to_string(), "0.0030679615757712823");
610/// assert_eq!(o, Equal);
611///
612/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shl_round(u32::MAX, Floor);
613/// assert_eq!(shifted.to_string(), "2.0985787164673858e323228496");
614/// assert_eq!(o, Less);
615///
616/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shl_round(u32::MAX, Ceiling);
617/// assert_eq!(shifted.to_string(), "Infinity");
618/// assert_eq!(o, Greater);
619/// ```
620///
621/// # shl_round_assign
622/// ```
623/// use malachite_base::num::arithmetic::traits::ShlRoundAssign;
624/// use malachite_base::rounding_modes::RoundingMode::*;
625/// use malachite_float::Float;
626/// use std::cmp::Ordering::*;
627///
628/// let mut x = Float::from(std::f64::consts::PI);
629/// assert_eq!(x.shl_round_assign(10u8, Nearest), Equal);
630/// assert_eq!(x.to_string(), "3216.9908772759482");
631///
632/// let mut x = Float::from(std::f64::consts::PI);
633/// assert_eq!(x.shl_round_assign(-10i8, Nearest), Equal);
634/// assert_eq!(x.to_string(), "0.0030679615757712823");
635///
636/// let mut x = Float::from(std::f64::consts::PI);
637/// assert_eq!(x.shl_round_assign(u32::MAX, Floor), Less);
638/// assert_eq!(x.to_string(), "2.0985787164673858e323228496");
639///
640/// let mut x = Float::from(std::f64::consts::PI);
641/// assert_eq!(x.shl_round_assign(u32::MAX, Ceiling), Greater);
642/// assert_eq!(x.to_string(), "Infinity");
643/// ```
644pub mod shl_round;
645/// Right-shifting a [`Float`](super::Float) (dividing it by a power of 2).
646///
647/// # shr
648/// ```
649/// use malachite_base::num::basic::traits::{Infinity, Zero};
650/// use malachite_float::Float;
651///
652/// assert_eq!(Float::ZERO >> 10, 0);
653/// assert_eq!(Float::INFINITY >> 10, Float::INFINITY);
654/// assert_eq!(
655///     (Float::from(std::f64::consts::PI) >> 10u8).to_string(),
656///     "0.0030679615757712823"
657/// );
658/// assert_eq!(
659///     (Float::from(std::f64::consts::PI) >> -10i8).to_string(),
660///     "3216.9908772759482"
661/// );
662///
663/// assert_eq!(&Float::ZERO >> 10, 0);
664/// assert_eq!(&Float::INFINITY >> 10, Float::INFINITY);
665/// assert_eq!(
666///     (&Float::from(std::f64::consts::PI) >> 10u8).to_string(),
667///     "0.0030679615757712823"
668/// );
669/// assert_eq!(
670///     (&Float::from(std::f64::consts::PI) >> -10i8).to_string(),
671///     "3216.9908772759482"
672/// );
673/// ```
674///
675/// # shr_assign
676/// ```
677/// use malachite_base::num::basic::traits::{Infinity, Zero};
678/// use malachite_float::Float;
679///
680/// let mut x = Float::ZERO;
681/// x >>= 10;
682/// assert_eq!(x, 0);
683///
684/// let mut x = Float::INFINITY;
685/// x >>= 10;
686/// assert_eq!(x, Float::INFINITY);
687///
688/// let mut x = Float::from(std::f64::consts::PI);
689/// x >>= 10;
690/// assert_eq!(x.to_string(), "0.0030679615757712823");
691///
692/// let mut x = Float::from(std::f64::consts::PI);
693/// x >>= -10;
694/// assert_eq!(x.to_string(), "3216.9908772759482");
695/// ```
696pub mod shr;
697/// Implementations of [`ShlRound`](malachite_base::num::arithmetic::traits::ShrRound) and
698/// [`ShrRoundAssign`](malachite_base::num::arithmetic::traits::ShrRoundAssign), traits for dividing
699/// a number by a power of 2 and rounding according to a specified
700/// [`RoundingMode`](malachite_base::rounding_modes::RoundingMode). For [`Float`](super::Float)s,
701/// rounding is only necessary in the cases of overflow and underflow.
702///
703/// # shr_prec_round
704/// ```
705/// use malachite_base::rounding_modes::RoundingMode::*;
706/// use malachite_float::Float;
707/// use std::cmp::Ordering::*;
708///
709/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round(10u8, 10, Nearest);
710/// assert_eq!(shifted.to_string(), "0.0030670");
711/// assert_eq!(o, Less);
712///
713/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round(-10i8, 10, Nearest);
714/// assert_eq!(shifted.to_string(), "3216.0");
715/// assert_eq!(o, Less);
716///
717/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round(u32::MAX, 10, Floor);
718/// assert_eq!(shifted.to_string(), "0.0");
719/// assert_eq!(o, Less);
720///
721/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round(u32::MAX, 10, Ceiling);
722/// assert_eq!(shifted.to_string(), "2.3826e-323228497");
723/// assert_eq!(o, Greater);
724///
725/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round_ref(10u8, 10, Nearest);
726/// assert_eq!(shifted.to_string(), "0.0030670");
727/// assert_eq!(o, Less);
728///
729/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round_ref(-10i8, 10, Nearest);
730/// assert_eq!(shifted.to_string(), "3216.0");
731/// assert_eq!(o, Less);
732///
733/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round_ref(u32::MAX, 10, Floor);
734/// assert_eq!(shifted.to_string(), "0.0");
735/// assert_eq!(o, Less);
736///
737/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round_ref(u32::MAX, 10, Ceiling);
738/// assert_eq!(shifted.to_string(), "2.3826e-323228497");
739/// assert_eq!(o, Greater);
740/// ```
741///
742/// # shr_prec_round_assign
743/// ```
744/// use malachite_base::rounding_modes::RoundingMode::*;
745/// use malachite_float::Float;
746/// use std::cmp::Ordering::*;
747///
748/// let mut x = Float::from(std::f64::consts::PI);
749/// assert_eq!(x.shr_prec_round_assign(10u8, 10, Nearest), Less);
750/// assert_eq!(x.to_string(), "0.0030670");
751///
752/// let mut x = Float::from(std::f64::consts::PI);
753/// assert_eq!(x.shr_prec_round_assign(-10i8, 10, Nearest), Less);
754/// assert_eq!(x.to_string(), "3216.0");
755///
756/// let mut x = Float::from(std::f64::consts::PI);
757/// assert_eq!(x.shr_prec_round_assign(u32::MAX, 10, Floor), Less);
758/// assert_eq!(x.to_string(), "0.0");
759///
760/// let mut x = Float::from(std::f64::consts::PI);
761/// assert_eq!(x.shr_prec_round_assign(u32::MAX, 10, Ceiling), Greater);
762/// assert_eq!(x.to_string(), "2.3826e-323228497");
763/// ```
764///
765/// # shr_prec
766/// ```
767/// use malachite_float::Float;
768/// use std::cmp::Ordering::*;
769///
770/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec(10u8, 10);
771/// assert_eq!(shifted.to_string(), "0.0030670");
772/// assert_eq!(o, Less);
773///
774/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec(-10i8, 10);
775/// assert_eq!(shifted.to_string(), "3216.0");
776/// assert_eq!(o, Less);
777///
778/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec(u32::MAX, 10);
779/// assert_eq!(shifted.to_string(), "0.0");
780/// assert_eq!(o, Less);
781///
782/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_ref(10u8, 10);
783/// assert_eq!(shifted.to_string(), "0.0030670");
784/// assert_eq!(o, Less);
785///
786/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_ref(-10i8, 10);
787/// assert_eq!(shifted.to_string(), "3216.0");
788/// assert_eq!(o, Less);
789///
790/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_ref(u32::MAX, 10);
791/// assert_eq!(shifted.to_string(), "0.0");
792/// assert_eq!(o, Less);
793/// ```
794///
795/// # shr_prec_assign
796/// ```
797/// use malachite_float::Float;
798/// use std::cmp::Ordering::*;
799///
800/// let mut x = Float::from(std::f64::consts::PI);
801/// assert_eq!(x.shr_prec_assign(10u8, 10), Less);
802/// assert_eq!(x.to_string(), "0.0030670");
803///
804/// let mut x = Float::from(std::f64::consts::PI);
805/// assert_eq!(x.shr_prec_assign(-10i8, 10), Less);
806/// assert_eq!(x.to_string(), "3216.0");
807///
808/// let mut x = Float::from(std::f64::consts::PI);
809/// assert_eq!(x.shr_prec_assign(u32::MAX, 10), Less);
810/// assert_eq!(x.to_string(), "0.0");
811/// ```
812///
813/// # shr_round
814/// ```
815/// use malachite_base::num::arithmetic::traits::ShrRound;
816/// use malachite_base::rounding_modes::RoundingMode::*;
817/// use malachite_float::Float;
818/// use std::cmp::Ordering::*;
819///
820/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_round(10u8, Nearest);
821/// assert_eq!(shifted.to_string(), "0.0030679615757712823");
822/// assert_eq!(o, Equal);
823///
824/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_round(-10i8, Nearest);
825/// assert_eq!(shifted.to_string(), "3216.9908772759482");
826/// assert_eq!(o, Equal);
827///
828/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_round(u32::MAX, Floor);
829/// assert_eq!(shifted.to_string(), "0.0");
830/// assert_eq!(o, Less);
831///
832/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_round(u32::MAX, Ceiling);
833/// assert_eq!(shifted.to_string(), "2.3825649048879511e-323228497");
834/// assert_eq!(o, Greater);
835///
836/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shr_round(10u8, Nearest);
837/// assert_eq!(shifted.to_string(), "0.0030679615757712823");
838/// assert_eq!(o, Equal);
839///
840/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shr_round(-10i8, Nearest);
841/// assert_eq!(shifted.to_string(), "3216.9908772759482");
842/// assert_eq!(o, Equal);
843///
844/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shr_round(u32::MAX, Floor);
845/// assert_eq!(shifted.to_string(), "0.0");
846/// assert_eq!(o, Less);
847///
848/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shr_round(u32::MAX, Ceiling);
849/// assert_eq!(shifted.to_string(), "2.3825649048879511e-323228497");
850/// assert_eq!(o, Greater);
851/// ```
852///
853/// # shr_round_assign
854/// ```
855/// use malachite_base::num::arithmetic::traits::ShrRoundAssign;
856/// use malachite_base::rounding_modes::RoundingMode::*;
857/// use malachite_float::Float;
858/// use std::cmp::Ordering::*;
859///
860/// let mut x = Float::from(std::f64::consts::PI);
861/// assert_eq!(x.shr_round_assign(10u8, Nearest), Equal);
862/// assert_eq!(x.to_string(), "0.0030679615757712823");
863///
864/// let mut x = Float::from(std::f64::consts::PI);
865/// assert_eq!(x.shr_round_assign(-10i8, Nearest), Equal);
866/// assert_eq!(x.to_string(), "3216.9908772759482");
867///
868/// let mut x = Float::from(std::f64::consts::PI);
869/// assert_eq!(x.shr_round_assign(u32::MAX, Floor), Less);
870/// assert_eq!(x.to_string(), "0.0");
871///
872/// let mut x = Float::from(std::f64::consts::PI);
873/// assert_eq!(x.shr_round_assign(u32::MAX, Ceiling), Greater);
874/// assert_eq!(x.to_string(), "2.3825649048879511e-323228497");
875/// ```
876pub mod shr_round;
877/// An implementation of [`Sign`](malachite_base::num::arithmetic::traits::Sign), a trait for
878/// determining the sign of a number.
879pub mod sign;
880/// Implementations of [`Sin`](malachite_base::num::arithmetic::traits::Sin) and
881/// [`SinAssign`](malachite_base::num::arithmetic::traits::SinAssign), traits for computing the sine
882/// of [`Float`](super::Float)s.
883pub mod sin;
884/// Implementations of [`SinCos`](malachite_base::num::arithmetic::traits::SinCos) and
885/// [`SinCosAssign`](malachite_base::num::arithmetic::traits::SinCosAssign), traits for computing
886/// the sine and cosine of [`Float`](super::Float)s together.
887pub mod sin_cos;
888/// Implementations of [`Sinh`](malachite_base::num::arithmetic::traits::Sinh) and
889/// [`SinhAssign`](malachite_base::num::arithmetic::traits::SinhAssign), traits for computing the
890/// hyperbolic sine of [`Float`](super::Float)s.
891pub mod sinh;
892/// Implementations of [`SinhCosh`](malachite_base::num::arithmetic::traits::SinhCosh) and
893/// [`SinhCoshAssign`](malachite_base::num::arithmetic::traits::SinhCoshAssign), traits for
894/// computing the hyperbolic sine and cosine of [`Float`](super::Float)s together.
895pub mod sinh_cosh;
896/// [`Sqrt`](malachite_base::num::arithmetic::traits::Sqrt) and
897/// [`SqrtAssign`](malachite_base::num::arithmetic::traits::SqrtAssign), traits for computing the
898/// square root of [`Float`](super::Float)s.
899pub mod sqrt;
900/// Squaring of [`Float`](super::Float)s.
901pub mod square;
902/// Subtraction of [`Float`](super::Float)s, of [`Float`](super::Float)s by
903/// [`Rational`](malachite_q::Rational)s, and of [`Rational`](malachite_q::Rational)s by
904/// [`Float`](super::Float)s.
905pub mod sub;
906/// [`SubMul`](malachite_base::num::arithmetic::traits::SubMul) and
907/// [`SubMulAssign`](malachite_base::num::arithmetic::traits::SubMulAssign), traits for subtracting
908/// the product of two [`Float`](super::Float)s — or of a [`Float`](super::Float) and a
909/// [`Rational`](malachite_q::Rational) — from another [`Float`](super::Float) with a single
910/// rounding (fused multiply-subtract), and the associated precision- and rounding-mode-aware
911/// functions.
912pub mod sub_mul;
913/// Correctly-rounded summation of any number of [`Float`](super::Float)s: functions computing a
914/// slice's sum with a single rounding at the end, and the [`Sum`](core::iter::Sum) implementations
915/// built on them.
916pub mod sum;
917pub mod tan;
918/// Implementations of [`Tanh`](malachite_base::num::arithmetic::traits::Tanh) and
919/// [`TanhAssign`](malachite_base::num::arithmetic::traits::TanhAssign), traits for computing the
920/// hyperbolic tangent of [`Float`](super::Float)s.
921pub mod tanh;