mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 08:41:34 +11:00
stop using references
This commit is contained in:
parent
900b594039
commit
6b725e90ad
|
@ -221,12 +221,12 @@ impl<I: FixedWidthUnsignedInteger, const N: usize> Num<I, N> {
|
||||||
self.0
|
self.0
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn trunc(&self) -> I {
|
pub fn trunc(self) -> I {
|
||||||
self.0 / (I::one() << N)
|
self.0 / (I::one() << N)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn rem_euclid(&self, rhs: Self) -> Self {
|
pub fn rem_euclid(self, rhs: Self) -> Self {
|
||||||
let r = *self % rhs;
|
let r = self % rhs;
|
||||||
if r < I::zero().into() {
|
if r < I::zero().into() {
|
||||||
if rhs < I::zero().into() {
|
if rhs < I::zero().into() {
|
||||||
r - rhs
|
r - rhs
|
||||||
|
@ -238,11 +238,11 @@ impl<I: FixedWidthUnsignedInteger, const N: usize> Num<I, N> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn floor(&self) -> I {
|
pub fn floor(self) -> I {
|
||||||
self.0 >> N
|
self.0 >> N
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn frac(&self) -> I {
|
pub fn frac(self) -> I {
|
||||||
self.0 & ((I::one() << N) - I::one())
|
self.0 & ((I::one() << N) - I::one())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue