Compare commits

...

11 Commits
2.0 ... main

Author SHA1 Message Date
array-in-a-matrix 86979c9d54 install/uninstall options 2023-02-07 23:16:34 -05:00
array-in-a-matrix 5583e2ddb8 install/uninstall options 2023-02-07 15:35:06 -05:00
array-in-a-matrix 870de20e20 install/uninstall options 2023-02-07 15:22:11 -05:00
array-in-a-matrix 3d6877c822 install/uninstall options 2023-02-07 08:39:10 -05:00
array-in-a-matrix 97dbc9fb7b space out im num 2023-02-06 15:38:34 -05:00
array-in-a-matrix 16e566bfa0 tui 2023-02-06 15:22:05 -05:00
array-in-a-matrix 5fa84b93fb added space between results 2022-12-06 13:57:48 -05:00
array-in-a-matrix 858990447e removed cringe 2022-10-04 11:48:01 -04:00
array-in-a-matrix 3bb69b067b typo 2022-09-26 18:01:15 -04:00
array-in-a-matrix 56fa33af33 cleaner output 2022-09-26 15:03:42 -04:00
array-in-a-matrix 8180560937 didnt rename tui properly 2021-11-15 19:02:18 -05:00
5 changed files with 17 additions and 8 deletions

1
.gitignore vendored
View File

@ -53,3 +53,4 @@ dkms.conf
# quadratic executable
quadratic
quadratic-tui

View File

@ -1,5 +1,3 @@
# quadratic
Simple cli calculator that computes real and complex roots of a quadratic.
<br>
Make a project do one thing good rather than do alot that isn't. I learned from my past projects and the best way to code is to KISS.

View File

@ -1,2 +1,12 @@
DESTDIR ?= /usr/bin
all:
gcc quadratic.c -lm -Wall -O3 -o "quadratic"
cp quadratic-tui.sh quadratic-tui
install:
install -Dm755 quadratic $(DESTDIR)/
install -Dm755 quadratic-tui $(DESTDIR)/
uninstall:
rm -f $(DESTDIR)/{quadratic,quadratic-tui}

View File

@ -4,7 +4,7 @@ ARG_A=$(whiptail --inputbox "Please enter the value for \"a\":" 10 50 --title "Q
exitstatus=$?
if [ $exitstatus != 0 ]; then
echo "User canceled input."
echo "User cancelled input."
exit
fi
@ -12,7 +12,7 @@ ARG_B=$(whiptail --inputbox "Please enter the value for \"b\":" 10 50 --title "Q
exitstatus=$?
if [ $exitstatus != 0 ]; then
echo "User canceled input."
echo "User cancelled input."
exit
fi
@ -20,7 +20,7 @@ ARG_C=$(whiptail --inputbox "Please enter the value for \"c\":" 10 50 --title "Q
exitstatus=$?
if [ $exitstatus != 0 ]; then
echo "User canceled input."
echo "User cancelled input."
exit
fi

View File

@ -9,7 +9,7 @@ int main(int num_arg, char **args)
if (num_arg <= 1)
{
system("/bin/sh /home/linux/Documents/Projects/quadratic/quadratic-tui"); //! need a better solution
system("quadratic-tui"); // make sure it is in PATH along with "quadratic" bin
}
else
{
@ -25,7 +25,7 @@ int main(int num_arg, char **args)
double real_part = (-num_B) / (2 * num_A);
double imaginary_part = sqrt(radical * -1.0) / (2 * num_A);
printf("%f+%fi %f-%fi\n", real_part, imaginary_part, real_part, imaginary_part);
printf("%g+%gi\t %g-%gi\n", real_part, imaginary_part, real_part, imaginary_part);
}
else
{
@ -35,7 +35,7 @@ int main(int num_arg, char **args)
double zero_1_ptr = numerator_1 / (2 * num_A);
double zero_2_ptr = numerator_2 / (2 * num_A);
printf("%f %f\n", zero_1_ptr, zero_2_ptr);
printf("%g\t %g\n", zero_1_ptr, zero_2_ptr);
};
};
return 0;