unit_conversions/
frequency.rs

1// <auto-generated>
2// This code was generated by the UnitCodeGenerator tool
3//
4// Changes to this file will be lost if the code is regenerated
5// </auto-generated>
6
7//! # Frequency based converters
8
9/// Gigahertz conversion functions
10pub mod gigahertz {
11	/// Converts the supplied Gigahertz value to Hertz
12	/// # Arguments
13	/// * `value` - The Gigahertz input value
14	pub fn to_hertz(value: f64) -> f64 {
15		return value * 1e+9;
16	}
17	/// Converts the supplied Gigahertz value to Kilohertz
18	/// # Arguments
19	/// * `value` - The Gigahertz input value
20	pub fn to_kilohertz(value: f64) -> f64 {
21		return value * 1e+6;
22	}
23	/// Converts the supplied Gigahertz value to Megahertz
24	/// # Arguments
25	/// * `value` - The Gigahertz input value
26	pub fn to_megahertz(value: f64) -> f64 {
27		return value * 1000.0;
28	}
29}
30/// Hertz conversion functions
31pub mod hertz {
32	/// Converts the supplied Hertz value to Kilohertz
33	/// # Arguments
34	/// * `value` - The Hertz input value
35	pub fn to_kilohertz(value: f64) -> f64 {
36		return value / 1000.0;
37	}
38	/// Converts the supplied Hertz value to Megahertz
39	/// # Arguments
40	/// * `value` - The Hertz input value
41	pub fn to_megahertz(value: f64) -> f64 {
42		return value / 1e+6;
43	}
44	/// Converts the supplied Hertz value to Gigahertz
45	/// # Arguments
46	/// * `value` - The Hertz input value
47	pub fn to_gigahertz(value: f64) -> f64 {
48		return value / 1e+9;
49	}
50}
51/// Kilohertz conversion functions
52pub mod kilohertz {
53	/// Converts the supplied Kilohertz value to Hertz
54	/// # Arguments
55	/// * `value` - The Kilohertz input value
56	pub fn to_hertz(value: f64) -> f64 {
57		return value * 1000.0;
58	}
59	/// Converts the supplied Kilohertz value to Megahertz
60	/// # Arguments
61	/// * `value` - The Kilohertz input value
62	pub fn to_megahertz(value: f64) -> f64 {
63		return value / 1000.0;
64	}
65	/// Converts the supplied Kilohertz value to Gigahertz
66	/// # Arguments
67	/// * `value` - The Kilohertz input value
68	pub fn to_gigahertz(value: f64) -> f64 {
69		return value / 1e+6;
70	}
71}
72/// Megahertz conversion functions
73pub mod megahertz {
74	/// Converts the supplied Megahertz value to Hertz
75	/// # Arguments
76	/// * `value` - The Megahertz input value
77	pub fn to_hertz(value: f64) -> f64 {
78		return value * 1e+6;
79	}
80	/// Converts the supplied Megahertz value to Kilohertz
81	/// # Arguments
82	/// * `value` - The Megahertz input value
83	pub fn to_kilohertz(value: f64) -> f64 {
84		return value * 1000.0;
85	}
86	/// Converts the supplied Megahertz value to Gigahertz
87	/// # Arguments
88	/// * `value` - The Megahertz input value
89	pub fn to_gigahertz(value: f64) -> f64 {
90		return value / 1000.0;
91	}
92}