1quantity! {
4 quantity: Action; "action";
6 dimension: ISQ<
8 P2, P1, N1, Z0, Z0, Z0, Z0>; units {
16 @joule_second: prefix!(none); "J · s", "joule second", "joule seconds";
17
18 @atomic_unit_of_action: 1.054_571_817_E-34; "ħ", "atomic unit of action",
20 "atomic units of action";
21 @reduced_planck_constant: 1.054_571_817_E-34; "ħ", "reduced planck constant",
22 "reduced planck constants";
23 @planck_constant: 6.626_070_15_E-34; "h", "planck constant", "planck constants";
24 @erg_second: 1.0_E-7; "erg · s", "erg second", "erg seconds";
25 @electronvolt_second: 1.602_176_634_E-19; "eV · s", "electronvolt second",
26 "electronvolt seconds";
27 }
28}
29
30#[cfg(test)]
31mod test {
32 storage_types! {
33 use crate::num::One;
34 use crate::si::quantities::*;
35 use crate::si::time as t;
36 use crate::si::energy as e;
37 use crate::si::action as act;
38 use crate::tests::Test;
39
40 #[test]
41 fn check_dimension() {
42 let _: Action<V> = Energy::new::<e::joule>(V::one())
43 * Time::new::<t::second>(V::one());
44 }
45
46 #[test]
47 fn check_units() {
48 test::<e::joule, t::second, act::joule_second>();
49 test::<e::erg, t::second, act::erg_second>();
50 test::<e::electronvolt, t::second, act::electronvolt_second>();
51
52 fn test<E: e::Conversion<V>, T: t::Conversion<V>, ACT: act::Conversion<V>>() {
53 Test::assert_approx_eq(&Action::new::<ACT>(V::one()),
54 &(Energy::new::<E>(V::one()) * Time::new::<T>(V::one())));
55 }
56 }
57 }
58}