Crates.io | natural_constants |
lib.rs | natural_constants |
version | 0.2.0 |
source | src |
created_at | 2017-02-20 13:52:08.449023 |
updated_at | 2022-10-11 12:33:58.960733 |
description | Pre-defined constants from all disciplines (math, physics, ...) |
homepage | |
repository | https://github.com/willi-kappler/natural_constants |
max_upload_size | |
id | 8604 |
size | 86,947 |
Pre-defined constants from all disciplines (math, physics, ...) as a Rust library.
Add this to your Cargo.toml file:
natural_constants = "0.2.0"
It's far from complete. So if your favorite constant is missing, just let me know.
What should go in ? Everything that you think is useful. Some constants may fit into multiple modules - we then have to decide which one.
Well simple characters are often used ("overloaded") by various constants, so to avoid ambiguity the full name is used.
Well no one stops you from doing s.th. like this:
use natural_constants::physics::*;
fn main() {
let c = speed_of_light_vac;
let m0 = 100.0;
// Use c in your code:
let E = m0 * c * c;
}
Yes, why not ? If it's useful to you, it may also be useful to others.
This is an ongoing effort to make Rust more suitable for scientific / numeric computing, you can join the discussion here.