Skip to main content

malachite_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/// Addition of [`Float`](super::Float)s, and of [`Float`](super::Float)s with
12/// [`Rational`](malachite_q::Rational)s.
13pub mod add;
14/// Taking the AGM (arithmetic-geometric mean) of two [`Float`](super::Float)s, and of
15/// [`Float`](super::Float)s with [`Rational`](malachite_q::Rational)s.
16pub mod agm;
17/// Division of [`Float`](super::Float)s, of [`Float`](super::Float)s by
18/// [`Rational`](malachite_q::Rational)s, and of [`Rational`](malachite_q::Rational)s by
19/// [`Float`](super::Float)s.
20pub mod div;
21/// An implementation of [`IsPowerOf2`](malachite_base::num::arithmetic::traits::IsPowerOf2), a
22/// trait for determining whether a number is an integer power of 2.
23pub mod is_power_of_2;
24/// Multiplication of [`Float`](super::Float)s, and of [`Float`](super::Float)s with
25/// [`Rational`](malachite_q::Rational)s.
26pub mod mul;
27/// Negation of [`Float`](super::Float)s.
28pub mod neg;
29/// Implementations of [`PowerOf2`](malachite_base::num::arithmetic::traits::PowerOf2), a trait for
30/// computing a power of 2.
31pub mod power_of_2;
32/// Implementations of [`Reciprocal`](malachite_base::num::arithmetic::traits::Reciprocal) and
33/// [`ReciprocalAssign`](malachite_base::num::arithmetic::traits::ReciprocalAssign), traits for
34/// computing the reciprocal of a number.
35pub mod reciprocal;
36/// [`ReciprocalSqrt`](malachite_base::num::arithmetic::traits::ReciprocalSqrt) and
37/// [`ReciprocalSqrtAssign`](malachite_base::num::arithmetic::traits::ReciprocalSqrtAssign), traits
38/// for computing the reciprocal of the square root of [`Float`](super::Float)s.
39pub mod reciprocal_sqrt;
40/// Left-shifting a [`Float`](super::Float) (multiplying it by a power of 2).
41///
42/// # shl
43/// ```
44/// use malachite_base::num::basic::traits::{Infinity, Zero};
45/// use malachite_float::Float;
46///
47/// assert_eq!(Float::ZERO << 10, 0);
48/// assert_eq!(Float::INFINITY << 10, Float::INFINITY);
49/// assert_eq!(
50///     (Float::from(std::f64::consts::PI) << 10u8).to_string(),
51///     "3216.990877275948"
52/// );
53/// assert_eq!(
54///     (Float::from(std::f64::consts::PI) << -10i8).to_string(),
55///     "0.003067961575771282"
56/// );
57///
58/// assert_eq!(&Float::ZERO << 10, 0);
59/// assert_eq!(&Float::INFINITY << 10, Float::INFINITY);
60/// assert_eq!(
61///     (&Float::from(std::f64::consts::PI) << 10u8).to_string(),
62///     "3216.990877275948"
63/// );
64/// assert_eq!(
65///     (&Float::from(std::f64::consts::PI) << -10i8).to_string(),
66///     "0.003067961575771282"
67/// );
68/// ```
69///
70/// # shl_assign
71/// ```
72/// use malachite_base::num::basic::traits::{Infinity, Zero};
73/// use malachite_float::Float;
74///
75/// let mut x = Float::ZERO;
76/// x <<= 10;
77/// assert_eq!(x, 0);
78///
79/// let mut x = Float::INFINITY;
80/// x <<= 10;
81/// assert_eq!(x, Float::INFINITY);
82///
83/// let mut x = Float::from(std::f64::consts::PI);
84/// x <<= 10;
85/// assert_eq!(x.to_string(), "3216.990877275948");
86///
87/// let mut x = Float::from(std::f64::consts::PI);
88/// x <<= -10;
89/// assert_eq!(x.to_string(), "0.003067961575771282");
90/// ```
91pub mod shl;
92/// Implementations of [`ShlRound`](malachite_base::num::arithmetic::traits::ShlRound) and
93/// [`ShlRoundAssign`](malachite_base::num::arithmetic::traits::ShlRoundAssign), traits for
94/// multiplying a number by a power of 2 and rounding according to a specified
95/// [`RoundingMode`](malachite_base::rounding_modes::RoundingMode). For [`Float`](super::Float)s,
96/// rounding is only necessary in the cases of overflow and underflow.
97///
98/// # shl_prec_round
99/// ```
100/// use malachite_base::rounding_modes::RoundingMode::*;
101/// use malachite_float::Float;
102/// use std::cmp::Ordering::*;
103///
104/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round(10u8, 10, Nearest);
105/// assert_eq!(shifted.to_string(), "3216.0");
106/// assert_eq!(o, Less);
107///
108/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round(-10i8, 10, Nearest);
109/// assert_eq!(shifted.to_string(), "0.003067");
110/// assert_eq!(o, Less);
111///
112/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round(u32::MAX, 10, Floor);
113/// assert_eq!(shifted.to_string(), "too_big");
114/// assert_eq!(o, Less);
115///
116/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round(u32::MAX, 10, Ceiling);
117/// assert_eq!(shifted.to_string(), "Infinity");
118/// assert_eq!(o, Greater);
119///
120/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round_ref(10u8, 10, Nearest);
121/// assert_eq!(shifted.to_string(), "3216.0");
122/// assert_eq!(o, Less);
123///
124/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round_ref(-10i8, 10, Nearest);
125/// assert_eq!(shifted.to_string(), "0.003067");
126/// assert_eq!(o, Less);
127///
128/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round_ref(u32::MAX, 10, Floor);
129/// assert_eq!(shifted.to_string(), "too_big");
130/// assert_eq!(o, Less);
131///
132/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_round_ref(u32::MAX, 10, Ceiling);
133/// assert_eq!(shifted.to_string(), "Infinity");
134/// assert_eq!(o, Greater);
135/// ```
136///
137/// # shl_prec_round_assign
138/// ```
139/// use malachite_base::rounding_modes::RoundingMode::*;
140/// use malachite_float::Float;
141/// use std::cmp::Ordering::*;
142///
143/// let mut x = Float::from(std::f64::consts::PI);
144/// assert_eq!(x.shl_prec_round_assign(10u8, 10, Nearest), Less);
145/// assert_eq!(x.to_string(), "3216.0");
146///
147/// let mut x = Float::from(std::f64::consts::PI);
148/// assert_eq!(x.shl_prec_round_assign(-10i8, 10, Nearest), Less);
149/// assert_eq!(x.to_string(), "0.003067");
150///
151/// let mut x = Float::from(std::f64::consts::PI);
152/// assert_eq!(x.shl_prec_round_assign(u32::MAX, 10, Floor), Less);
153/// assert_eq!(x.to_string(), "too_big");
154///
155/// let mut x = Float::from(std::f64::consts::PI);
156/// assert_eq!(x.shl_prec_round_assign(u32::MAX, 10, Ceiling), Greater);
157/// assert_eq!(x.to_string(), "Infinity");
158/// ```
159///
160/// # shl_prec
161/// ```
162/// use malachite_float::Float;
163/// use std::cmp::Ordering::*;
164///
165/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec(10u8, 10);
166/// assert_eq!(shifted.to_string(), "3216.0");
167/// assert_eq!(o, Less);
168///
169/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec(-10i8, 10);
170/// assert_eq!(shifted.to_string(), "0.003067");
171/// assert_eq!(o, Less);
172///
173/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec(u32::MAX, 10);
174/// assert_eq!(shifted.to_string(), "Infinity");
175/// assert_eq!(o, Greater);
176///
177/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_ref(10u8, 10);
178/// assert_eq!(shifted.to_string(), "3216.0");
179/// assert_eq!(o, Less);
180///
181/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_ref(-10i8, 10);
182/// assert_eq!(shifted.to_string(), "0.003067");
183/// assert_eq!(o, Less);
184///
185/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_prec_ref(u32::MAX, 10);
186/// assert_eq!(shifted.to_string(), "Infinity");
187/// assert_eq!(o, Greater);
188/// ```
189///
190/// # shl_prec_assign
191/// ```
192/// use malachite_float::Float;
193/// use std::cmp::Ordering::*;
194///
195/// let mut x = Float::from(std::f64::consts::PI);
196/// assert_eq!(x.shl_prec_assign(10u8, 10), Less);
197/// assert_eq!(x.to_string(), "3216.0");
198///
199/// let mut x = Float::from(std::f64::consts::PI);
200/// assert_eq!(x.shl_prec_assign(-10i8, 10), Less);
201/// assert_eq!(x.to_string(), "0.003067");
202///
203/// let mut x = Float::from(std::f64::consts::PI);
204/// assert_eq!(x.shl_prec_assign(u32::MAX, 10), Greater);
205/// assert_eq!(x.to_string(), "Infinity");
206/// ```
207///
208/// # shl_round
209/// ```
210/// use malachite_base::num::arithmetic::traits::ShlRound;
211/// use malachite_base::rounding_modes::RoundingMode::*;
212/// use malachite_float::Float;
213/// use std::cmp::Ordering::*;
214///
215/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_round(10u8, Nearest);
216/// assert_eq!(shifted.to_string(), "3216.990877275948");
217/// assert_eq!(o, Equal);
218///
219/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_round(-10i8, Nearest);
220/// assert_eq!(shifted.to_string(), "0.003067961575771282");
221/// assert_eq!(o, Equal);
222///
223/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_round(u32::MAX, Floor);
224/// assert_eq!(shifted.to_string(), "too_big");
225/// assert_eq!(o, Less);
226///
227/// let (shifted, o) = Float::from(std::f64::consts::PI).shl_round(u32::MAX, Ceiling);
228/// assert_eq!(shifted.to_string(), "Infinity");
229/// assert_eq!(o, Greater);
230///
231/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shl_round(10u8, Nearest);
232/// assert_eq!(shifted.to_string(), "3216.990877275948");
233/// assert_eq!(o, Equal);
234///
235/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shl_round(-10i8, Nearest);
236/// assert_eq!(shifted.to_string(), "0.003067961575771282");
237/// assert_eq!(o, Equal);
238///
239/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shl_round(u32::MAX, Floor);
240/// assert_eq!(shifted.to_string(), "too_big");
241/// assert_eq!(o, Less);
242///
243/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shl_round(u32::MAX, Ceiling);
244/// assert_eq!(shifted.to_string(), "Infinity");
245/// assert_eq!(o, Greater);
246/// ```
247///
248/// # shl_round_assign
249/// ```
250/// use malachite_base::num::arithmetic::traits::ShlRoundAssign;
251/// use malachite_base::rounding_modes::RoundingMode::*;
252/// use malachite_float::Float;
253/// use std::cmp::Ordering::*;
254///
255/// let mut x = Float::from(std::f64::consts::PI);
256/// assert_eq!(x.shl_round_assign(10u8, Nearest), Equal);
257/// assert_eq!(x.to_string(), "3216.990877275948");
258///
259/// let mut x = Float::from(std::f64::consts::PI);
260/// assert_eq!(x.shl_round_assign(-10i8, Nearest), Equal);
261/// assert_eq!(x.to_string(), "0.003067961575771282");
262///
263/// let mut x = Float::from(std::f64::consts::PI);
264/// assert_eq!(x.shl_round_assign(u32::MAX, Floor), Less);
265/// assert_eq!(x.to_string(), "too_big");
266///
267/// let mut x = Float::from(std::f64::consts::PI);
268/// assert_eq!(x.shl_round_assign(u32::MAX, Ceiling), Greater);
269/// assert_eq!(x.to_string(), "Infinity");
270/// ```
271pub mod shl_round;
272/// Right-shifting a [`Float`](super::Float) (dividing it by a power of 2).
273///
274/// # shr
275/// ```
276/// use malachite_base::num::basic::traits::{Infinity, Zero};
277/// use malachite_float::Float;
278///
279/// assert_eq!(Float::ZERO >> 10, 0);
280/// assert_eq!(Float::INFINITY >> 10, Float::INFINITY);
281/// assert_eq!(
282///     (Float::from(std::f64::consts::PI) >> 10u8).to_string(),
283///     "0.003067961575771282"
284/// );
285/// assert_eq!(
286///     (Float::from(std::f64::consts::PI) >> -10i8).to_string(),
287///     "3216.990877275948"
288/// );
289///
290/// assert_eq!(&Float::ZERO >> 10, 0);
291/// assert_eq!(&Float::INFINITY >> 10, Float::INFINITY);
292/// assert_eq!(
293///     (&Float::from(std::f64::consts::PI) >> 10u8).to_string(),
294///     "0.003067961575771282"
295/// );
296/// assert_eq!(
297///     (&Float::from(std::f64::consts::PI) >> -10i8).to_string(),
298///     "3216.990877275948"
299/// );
300/// ```
301///
302/// # shr_assign
303/// ```
304/// use malachite_base::num::basic::traits::{Infinity, Zero};
305/// use malachite_float::Float;
306///
307/// let mut x = Float::ZERO;
308/// x >>= 10;
309/// assert_eq!(x, 0);
310///
311/// let mut x = Float::INFINITY;
312/// x >>= 10;
313/// assert_eq!(x, Float::INFINITY);
314///
315/// let mut x = Float::from(std::f64::consts::PI);
316/// x >>= 10;
317/// assert_eq!(x.to_string(), "0.003067961575771282");
318///
319/// let mut x = Float::from(std::f64::consts::PI);
320/// x >>= -10;
321/// assert_eq!(x.to_string(), "3216.990877275948");
322/// ```
323pub mod shr;
324/// Implementations of [`ShlRound`](malachite_base::num::arithmetic::traits::ShrRound) and
325/// [`ShrRoundAssign`](malachite_base::num::arithmetic::traits::ShrRoundAssign), traits for dividing
326/// a number by a power of 2 and rounding according to a specified
327/// [`RoundingMode`](malachite_base::rounding_modes::RoundingMode). For [`Float`](super::Float)s,
328/// rounding is only necessary in the cases of overflow and underflow.
329///
330/// # shr_prec_round
331/// ```
332/// use malachite_base::rounding_modes::RoundingMode::*;
333/// use malachite_float::Float;
334/// use std::cmp::Ordering::*;
335///
336/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round(10u8, 10, Nearest);
337/// assert_eq!(shifted.to_string(), "0.003067");
338/// assert_eq!(o, Less);
339///
340/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round(-10i8, 10, Nearest);
341/// assert_eq!(shifted.to_string(), "3216.0");
342/// assert_eq!(o, Less);
343///
344/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round(u32::MAX, 10, Floor);
345/// assert_eq!(shifted.to_string(), "0.0");
346/// assert_eq!(o, Less);
347///
348/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round(u32::MAX, 10, Ceiling);
349/// assert_eq!(shifted.to_string(), "too_small");
350/// assert_eq!(o, Greater);
351///
352/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round_ref(10u8, 10, Nearest);
353/// assert_eq!(shifted.to_string(), "0.003067");
354/// assert_eq!(o, Less);
355///
356/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round_ref(-10i8, 10, Nearest);
357/// assert_eq!(shifted.to_string(), "3216.0");
358/// assert_eq!(o, Less);
359///
360/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round_ref(u32::MAX, 10, Floor);
361/// assert_eq!(shifted.to_string(), "0.0");
362/// assert_eq!(o, Less);
363///
364/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_round_ref(u32::MAX, 10, Ceiling);
365/// assert_eq!(shifted.to_string(), "too_small");
366/// assert_eq!(o, Greater);
367/// ```
368///
369/// # shr_prec_round_assign
370/// ```
371/// use malachite_base::rounding_modes::RoundingMode::*;
372/// use malachite_float::Float;
373/// use std::cmp::Ordering::*;
374///
375/// let mut x = Float::from(std::f64::consts::PI);
376/// assert_eq!(x.shr_prec_round_assign(10u8, 10, Nearest), Less);
377/// assert_eq!(x.to_string(), "0.003067");
378///
379/// let mut x = Float::from(std::f64::consts::PI);
380/// assert_eq!(x.shr_prec_round_assign(-10i8, 10, Nearest), Less);
381/// assert_eq!(x.to_string(), "3216.0");
382///
383/// let mut x = Float::from(std::f64::consts::PI);
384/// assert_eq!(x.shr_prec_round_assign(u32::MAX, 10, Floor), Less);
385/// assert_eq!(x.to_string(), "0.0");
386///
387/// let mut x = Float::from(std::f64::consts::PI);
388/// assert_eq!(x.shr_prec_round_assign(u32::MAX, 10, Ceiling), Greater);
389/// assert_eq!(x.to_string(), "too_small");
390/// ```
391///
392/// # shr_prec
393/// ```
394/// use malachite_float::Float;
395/// use std::cmp::Ordering::*;
396///
397/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec(10u8, 10);
398/// assert_eq!(shifted.to_string(), "0.003067");
399/// assert_eq!(o, Less);
400///
401/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec(-10i8, 10);
402/// assert_eq!(shifted.to_string(), "3216.0");
403/// assert_eq!(o, Less);
404///
405/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec(u32::MAX, 10);
406/// assert_eq!(shifted.to_string(), "0.0");
407/// assert_eq!(o, Less);
408///
409/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_ref(10u8, 10);
410/// assert_eq!(shifted.to_string(), "0.003067");
411/// assert_eq!(o, Less);
412///
413/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_ref(-10i8, 10);
414/// assert_eq!(shifted.to_string(), "3216.0");
415/// assert_eq!(o, Less);
416///
417/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_prec_ref(u32::MAX, 10);
418/// assert_eq!(shifted.to_string(), "0.0");
419/// assert_eq!(o, Less);
420/// ```
421///
422/// # shr_prec_assign
423/// ```
424/// use malachite_float::Float;
425/// use std::cmp::Ordering::*;
426///
427/// let mut x = Float::from(std::f64::consts::PI);
428/// assert_eq!(x.shr_prec_assign(10u8, 10), Less);
429/// assert_eq!(x.to_string(), "0.003067");
430///
431/// let mut x = Float::from(std::f64::consts::PI);
432/// assert_eq!(x.shr_prec_assign(-10i8, 10), Less);
433/// assert_eq!(x.to_string(), "3216.0");
434///
435/// let mut x = Float::from(std::f64::consts::PI);
436/// assert_eq!(x.shr_prec_assign(u32::MAX, 10), Less);
437/// assert_eq!(x.to_string(), "0.0");
438/// ```
439///
440/// # shr_round
441/// ```
442/// use malachite_base::num::arithmetic::traits::ShrRound;
443/// use malachite_base::rounding_modes::RoundingMode::*;
444/// use malachite_float::Float;
445/// use std::cmp::Ordering::*;
446///
447/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_round(10u8, Nearest);
448/// assert_eq!(shifted.to_string(), "0.003067961575771282");
449/// assert_eq!(o, Equal);
450///
451/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_round(-10i8, Nearest);
452/// assert_eq!(shifted.to_string(), "3216.990877275948");
453/// assert_eq!(o, Equal);
454///
455/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_round(u32::MAX, Floor);
456/// assert_eq!(shifted.to_string(), "0.0");
457/// assert_eq!(o, Less);
458///
459/// let (shifted, o) = Float::from(std::f64::consts::PI).shr_round(u32::MAX, Ceiling);
460/// assert_eq!(shifted.to_string(), "too_small");
461/// assert_eq!(o, Greater);
462///
463/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shr_round(10u8, Nearest);
464/// assert_eq!(shifted.to_string(), "0.003067961575771282");
465/// assert_eq!(o, Equal);
466///
467/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shr_round(-10i8, Nearest);
468/// assert_eq!(shifted.to_string(), "3216.990877275948");
469/// assert_eq!(o, Equal);
470///
471/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shr_round(u32::MAX, Floor);
472/// assert_eq!(shifted.to_string(), "0.0");
473/// assert_eq!(o, Less);
474///
475/// let (shifted, o) = (&Float::from(std::f64::consts::PI)).shr_round(u32::MAX, Ceiling);
476/// assert_eq!(shifted.to_string(), "too_small");
477/// assert_eq!(o, Greater);
478/// ```
479///
480/// # shr_round_assign
481/// ```
482/// use malachite_base::num::arithmetic::traits::ShrRoundAssign;
483/// use malachite_base::rounding_modes::RoundingMode::*;
484/// use malachite_float::Float;
485/// use std::cmp::Ordering::*;
486///
487/// let mut x = Float::from(std::f64::consts::PI);
488/// assert_eq!(x.shr_round_assign(10u8, Nearest), Equal);
489/// assert_eq!(x.to_string(), "0.003067961575771282");
490///
491/// let mut x = Float::from(std::f64::consts::PI);
492/// assert_eq!(x.shr_round_assign(-10i8, Nearest), Equal);
493/// assert_eq!(x.to_string(), "3216.990877275948");
494///
495/// let mut x = Float::from(std::f64::consts::PI);
496/// assert_eq!(x.shr_round_assign(u32::MAX, Floor), Less);
497/// assert_eq!(x.to_string(), "0.0");
498///
499/// let mut x = Float::from(std::f64::consts::PI);
500/// assert_eq!(x.shr_round_assign(u32::MAX, Ceiling), Greater);
501/// assert_eq!(x.to_string(), "too_small");
502/// ```
503pub mod shr_round;
504/// An implementation of [`Sign`](malachite_base::num::arithmetic::traits::Sign), a trait for
505/// determining the sign of a number.
506pub mod sign;
507/// [`Sqrt`](malachite_base::num::arithmetic::traits::Sqrt) and
508/// [`SqrtAssign`](malachite_base::num::arithmetic::traits::SqrtAssign), traits for computing the
509/// square root of [`Float`](super::Float)s.
510pub mod sqrt;
511/// Squaring of [`Float`](super::Float)s.
512pub mod square;
513/// Subtraction of [`Float`](super::Float)s, of [`Float`](super::Float)s by
514/// [`Rational`](malachite_q::Rational)s, and of [`Rational`](malachite_q::Rational)s by
515/// [`Float`](super::Float)s.
516pub mod sub;