initial commit

This commit is contained in:
2024-08-14 15:30:24 +05:30
parent 53e635ac89
commit 429ba7ef5e
4 changed files with 21 additions and 0 deletions

0
python/toUpload Normal file
View File

1
rust/day1/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/target

6
rust/day1/Cargo.toml Normal file
View File

@@ -0,0 +1,6 @@
[package]
name = "day1"
version = "0.1.0"
edition = "2021"
[dependencies]

14
rust/day1/src/main.rs Normal file
View File

@@ -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<f32> {
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];
}