Skip to content

Commit 59b551f

Browse files
committed
Correct the method name of RemEuclidU32
1 parent 7616c3a commit 59b551f

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/modint.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl<M: Modulus> StaticModInt<M> {
4545
/// Creates a new `StaticModInt`.
4646
#[inline]
4747
pub fn new<T: RemEuclidU32>(val: T) -> Self {
48-
Self::raw(val.into_representative(M::VALUE))
48+
Self::raw(val.rem_euclid_u32(M::VALUE))
4949
}
5050

5151
/// Corresponds to `atcoder::static_modint::raw` in the original ACL.
@@ -287,7 +287,7 @@ pub trait ModIntBase:
287287

288288
#[inline]
289289
fn new<T: RemEuclidU32>(val: T) -> Self {
290-
Self::raw(val.into_representative(Self::modulus()))
290+
Self::raw(val.rem_euclid_u32(Self::modulus()))
291291
}
292292

293293
#[inline]
@@ -306,65 +306,65 @@ pub trait ModIntBase:
306306
}
307307

308308
pub trait RemEuclidU32 {
309-
fn into_representative(self, modulus: u32) -> u32;
309+
fn rem_euclid_u32(self, modulus: u32) -> u32;
310310
}
311311

312-
macro_rules! impl_into_representative_for_small_signed {
312+
macro_rules! impl_rem_euclid_u32_for_small_signed {
313313
($($ty:tt),*) => {
314314
$(
315315
impl RemEuclidU32 for $ty {
316316
#[inline]
317-
fn into_representative(self, modulus: u32) -> u32 {
317+
fn rem_euclid_u32(self, modulus: u32) -> u32 {
318318
(self as i64).rem_euclid(i64::from(modulus)) as _
319319
}
320320
}
321321
)*
322322
}
323323
}
324324

325-
impl_into_representative_for_small_signed!(i8, i16, i32, i64, isize);
325+
impl_rem_euclid_u32_for_small_signed!(i8, i16, i32, i64, isize);
326326

327327
impl RemEuclidU32 for i128 {
328328
#[inline]
329-
fn into_representative(self, modulus: u32) -> u32 {
329+
fn rem_euclid_u32(self, modulus: u32) -> u32 {
330330
self.rem_euclid(i128::from(modulus)) as _
331331
}
332332
}
333333

334-
macro_rules! impl_into_representative_for_small_unsigned {
334+
macro_rules! impl_rem_euclid_u32_for_small_unsigned {
335335
($($ty:tt),*) => {
336336
$(
337337
impl RemEuclidU32 for $ty {
338338
#[inline]
339-
fn into_representative(self, modulus: u32) -> u32 {
339+
fn rem_euclid_u32(self, modulus: u32) -> u32 {
340340
self as u32 % modulus
341341
}
342342
}
343343
)*
344344
}
345345
}
346346

347-
macro_rules! impl_into_representative_for_large_unsigned {
347+
macro_rules! impl_rem_euclid_u32_for_large_unsigned {
348348
($($ty:tt),*) => {
349349
$(
350350
impl RemEuclidU32 for $ty {
351351
#[inline]
352-
fn into_representative(self, modulus: u32) -> u32 {
352+
fn rem_euclid_u32(self, modulus: u32) -> u32 {
353353
(self % (modulus as $ty)) as _
354354
}
355355
}
356356
)*
357357
}
358358
}
359359

360-
impl_into_representative_for_small_unsigned!(u8, u16, u32);
361-
impl_into_representative_for_large_unsigned!(u64, u128);
360+
impl_rem_euclid_u32_for_small_unsigned!(u8, u16, u32);
361+
impl_rem_euclid_u32_for_large_unsigned!(u64, u128);
362362

363363
#[cfg(target_pointer_width = "32")]
364-
impl_into_representative_for_small_unsigned!(usize);
364+
impl_rem_euclid_u32_for_small_unsigned!(usize);
365365

366366
#[cfg(target_pointer_width = "64")]
367-
impl_into_representative_for_large_unsigned!(usize);
367+
impl_rem_euclid_u32_for_large_unsigned!(usize);
368368

369369
trait InternalImplementations: ModIntBase {
370370
#[inline]

0 commit comments

Comments
 (0)