update copyright date
This commit is contained in:
parent
36ef9cae03
commit
4c25f002a1
|
@ -1,4 +1,4 @@
|
|||
# Copyright © 2018–2019 Trevor Spiteri
|
||||
# Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
# Copying and distribution of this file, with or without modification,
|
||||
# are permitted in any medium without royalty provided the copyright
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Copyright © 2018–2019 Trevor Spiteri
|
||||
Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!-- Copyright © 2018–2019 Trevor Spiteri -->
|
||||
<!-- Copyright © 2018–2020 Trevor Spiteri -->
|
||||
|
||||
<!-- Copying and distribution of this file, with or without
|
||||
modification, are permitted in any medium without royalty provided the
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!-- Copyright © 2018–2019 Trevor Spiteri -->
|
||||
<!-- Copyright © 2018–2020 Trevor Spiteri -->
|
||||
|
||||
<!-- Copying and distribution of this file, with or without
|
||||
modification, are permitted in any medium without royalty provided the
|
||||
|
|
2
build.rs
2
build.rs
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// Copying and distribution of this file, with or without
|
||||
// modification, are permitted in any medium without royalty provided
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
18
src/log10.rs
18
src/log10.rs
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
@ -277,7 +277,7 @@ mod tests {
|
|||
use super::IntFracLog10;
|
||||
|
||||
macro_rules! check_loop {
|
||||
($T:ty, $max:expr, $min:expr) => {
|
||||
($T:ty, $max:expr) => {
|
||||
assert_eq!(<$T>::max_value().int_part_log10(), $max);
|
||||
for i in 0..=$max {
|
||||
let p = (10 as $T).pow(i as u32);
|
||||
|
@ -288,8 +288,8 @@ mod tests {
|
|||
assert_eq!((p + 1).int_part_log10(), i);
|
||||
}
|
||||
|
||||
assert_eq!((1 as $T).frac_part_log10(), $min);
|
||||
for i in 0..-$min {
|
||||
assert_eq!((1 as $T).frac_part_log10(), -1 - $max);
|
||||
for i in 0..=$max {
|
||||
let p = <$T>::max_value() / (10 as $T).pow(i as u32);
|
||||
if p > 1 {
|
||||
assert_eq!((p - 1).frac_part_log10(), -1 - i);
|
||||
|
@ -304,26 +304,26 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn log10_u8() {
|
||||
check_loop! { u8, 2, -3 }
|
||||
check_loop! { u8, 2 }
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn log10_u16() {
|
||||
check_loop! { u16, 4, -5 }
|
||||
check_loop! { u16, 4 }
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn log10_u32() {
|
||||
check_loop! { u32, 9, -10 }
|
||||
check_loop! { u32, 9 }
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn log10_u64() {
|
||||
check_loop! { u64, 19, -20 }
|
||||
check_loop! { u64, 19 }
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn log10_u128() {
|
||||
check_loop! { u128, 38, -39 }
|
||||
check_loop! { u128, 38 }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright © 2018–2019 Trevor Spiteri
|
||||
// Copyright © 2018–2020 Trevor Spiteri
|
||||
|
||||
// This library is free software: you can redistribute it and/or
|
||||
// modify it under the terms of either
|
||||
|
|
Loading…
Reference in New Issue