diff --git a/python/toUpload b/python/toUpload new file mode 100644 index 0000000..e69de29 diff --git a/rust/day1/.gitignore b/rust/day1/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/rust/day1/.gitignore @@ -0,0 +1 @@ +/target diff --git a/rust/day1/Cargo.toml b/rust/day1/Cargo.toml new file mode 100644 index 0000000..fb6b7ec --- /dev/null +++ b/rust/day1/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "day1" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/rust/day1/src/main.rs b/rust/day1/src/main.rs new file mode 100644 index 0000000..6e88184 --- /dev/null +++ b/rust/day1/src/main.rs @@ -0,0 +1,14 @@ +fn main() { + println!("{:?}", calEVlas(-5.0, -7.0, 2.0, 4.0)); +} + +fn calEVlas(a: f32, b: f32, c: f32, d: f32) -> Vec { + let trace = a + d; + let determinant = (a * d) - (b * c); + println!("{determinant}"); + let discri = (trace.powi(2)) - (4.0 * determinant); + println!("{discri}"); + let x1 = (-trace + (discri.powf(0.5))) / 2.0; + let x2 = (-trace - (discri.powf(0.5))) / 2.0; + return vec![x1, x2]; +}