1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use super::Base;

/// Subtraction
pub trait Sub: Base + crate::rust_std::ops::Sub<Self, Output = Self> {
	/// Performs plain subtraction
	///
	/// It does the same as what the `-` operator does
	///
	/// # Examples
	///
	/// TODO
	#[inline]
	fn sub_regular(self, rhs: Self) -> Self {
		self - rhs
	}
}

macro_rules! impl_num_trait_sub {
	{ $($num:ident)* } => {
		$(
			impl Sub for $num {}
		)*
	}
}

impl_num_trait_sub! {
	u8 u16 u32 u64 u128 usize
	i8 i16 i32 i64 i128 isize
	f32 f64
}