From 33218f0960fb5d08036d0758ed0089abb64cae40 Mon Sep 17 00:00:00 2001 From: zombie Date: Sat, 22 Jan 2022 07:40:17 -0500 Subject: [PATCH] i made the quadratic formula what a suprise @quantum thooooommmmmaaasss it dont work plez help it gives wrong answer --- 3xplus1.c | 4 ++-- a.out | Bin 17584 -> 17960 bytes quadratic.c | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 quadratic.c diff --git a/3xplus1.c b/3xplus1.c index ff58fe1..0ca82ce 100644 --- a/3xplus1.c +++ b/3xplus1.c @@ -9,7 +9,7 @@ int main( int argc, char *argv[] ) { //yoinked from the internet argc is number return 0; //idk if this is how i should return an error idk @quantum rip my code to shreads } - x = atoi(argv[1]); + x = atoi(argv[1]); //mmmm yes the atoi is made out of atoi if(x == 0){ puts("uhhhh you entered 0 this wont end"); @@ -21,7 +21,7 @@ int main( int argc, char *argv[] ) { //yoinked from the internet argc is number while(x != 1){ //while x is not true i think - printf("%d\n",x ); + printf("%d\n",x ); //shit like this was difficualt in asm because i had to preserve all my registers if(x & 1 == 1){ //if x is odd x = (3 * x) + 1; } diff --git a/a.out b/a.out index f9681a77583583a454566610cab250ff3cffb32e..46dc46796d2e91ca7a3486b09efd7e7a5a01fc0e 100755 GIT binary patch delta 3894 zcmZ`6Yfx0z`JB7=EPGkt?k*sUiYzKV%Pt~_sK|n1mIh}~Lqi;mEU?Hn%L4l_cBZ##X;jH%;!m#3Qc)#JMQ)?c`ZuUb z>X2w2kd0>3WvYC-_Uo`;Q0b%m1TEn0)GnnoPbq$xzH1$EsPadU$Av>B|IgbR&D$C- z8J@ICswoi&9mi}bA21Z;)hFJ$@X;$Bi!y&={`=_QNbks&iHm&1aDZDxkvjNWLN0xr zTg3v}qO8y0%G)b78Bc8!d7hZZz6B0d?OlrA0X{0)Ic1Gvcpwzvm&8r6UT3(^xrqe) z9i1xnSaVaujzbmB3TKs?ngF?B$~XO@)rSWTdc{2 zM{;eCw-A$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$P|Fuv?a~{Byejxt1*0+FVf4s;ROBf)HyBtFoA)Fx?uVQCP+C zIMB9;`gG99>xD#H*#2V3kk$x1(^jYU9x=oPSZfQbp9<+YP}{@mcdHFu3KA$0{s3XK ZK@KHby&*+ltvzf%+Gt1v6rO3m_rD<9L398B diff --git a/quadratic.c b/quadratic.c new file mode 100644 index 0000000..f3c5c1e --- /dev/null +++ b/quadratic.c @@ -0,0 +1,40 @@ +#include //printf and shit +#include //website told me to use fabs for floating point absolute value + +int main( int argc, char *argv[] ) { //yoinked from the internet argc is number of args and argv is a "array of arguments" + + int a, b, c; //uhhhhhh how to ascii to float + + float x, deter, plusans, minusans; + + + const float pi = 3.1415926535897932384626338f; + + printf("%f\n", pi); //did i print pi corectly??? + + if(argc != 4){ + puts("please provide a b c"); + return 0; //idk if this is how i should return an error idk @quantum rip my code to shreads + } + + a = atoi(argv[1]); //mmmm yes the atoi is made out of atoi + b = atoi(argv[2]); //mmmm yes the atoi is made out of atoi + c = atoi(argv[3]); //mmmm yes the atoi is made out of atoi + + printf("Got: %dx²+%dx+%d\n", a, b, c); //wow this looks like ass + + deter = (b^2)-(4*a*c); + //deter = 12f; + printf("Deter = %f\n", deter); + if(deter < 0){ + puts("deter is negitve this will result in a imaginary number"); + return 0; + } + + plusans = (-b + sqrt(deter))/(2*a); //pemdas is cringe + printf("Plusans = %f\n", plusans); + minusans = (-b - sqrt(deter))/(2*a); //pemdas is cringe + printf("Minusans = %f\n", minusans); + + return 0; +}