malachite_nz/integer/conversion/is_real.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
9use crate::integer::Integer;
10use malachite_base::num::conversion::traits::IsReal;
11
12impl IsReal for &Integer {
13 /// Determines whether an [`Integer`] is a real number. It always returns `true`.
14 ///
15 /// $f(x) = \textrm{true}$.
16 ///
17 /// # Worst-case complexity
18 /// Constant time and additional memory.
19 ///
20 /// # Examples
21 /// ```
22 /// use malachite_base::num::basic::traits::{One, Zero};
23 /// use malachite_base::num::conversion::traits::IsReal;
24 /// use malachite_nz::integer::Integer;
25 ///
26 /// assert_eq!(Integer::ZERO.is_real(), true);
27 /// assert_eq!(Integer::ONE.is_real(), true);
28 /// assert_eq!(Integer::from(-100).is_real(), true);
29 /// ```
30 #[inline]
31 fn is_real(self) -> bool {
32 true
33 }
34}