uom/si/
temperature_coefficient.rs1quantity! {
4 quantity: TemperatureCoefficient; "temperature coefficient";
6 dimension: ISQ<
8 Z0, Z0, Z0, Z0, N1, Z0, Z0>; units {
16 @per_kelvin: prefix!(none); "K⁻¹", "per kelvin", "per kelvin";
17 @ppm_per_kelvin: 1E-6; "ppm/K", "ppm per kelvin", "ppm per kelvin";
18 @ppm_per_degree_celsius: 1E-6; "ppm/°C", "ppm per degree Celsius", "ppm per degree Celsius";
19 }
20}
21
22#[cfg(test)]
23mod test {
24 storage_types! {
25 use crate::num::One;
26 use crate::si::temperature_interval as ti;
27 use crate::si::temperature_coefficient as tc;
28 use crate::si::quantities::*;
29 use crate::tests::Test;
30
31 #[test]
32 fn check_dimension() {
33 let _: TemperatureCoefficient<V> = V::one()
34 / TemperatureInterval::new::<ti::kelvin>(V::one());
35 }
36
37 #[test]
38 fn check_units() {
39 test::<ti::kelvin, tc::per_kelvin>();
40 test::<ti::megakelvin, tc::ppm_per_kelvin>();
41 test::<ti::megakelvin, tc::ppm_per_degree_celsius>();
42
43 fn test<TI: ti::Conversion<V>, TC: tc::Conversion<V>>() {
44 Test::assert_approx_eq(&TemperatureCoefficient::new::<TC>(V::one()),
45 &(V::one()
46 / TemperatureInterval::new::<TI>(V::one())));
47 }
48 }
49 }
50}