Compare commits

..

No commits in common. "main" and "2.0" have entirely different histories.
main ... 2.0

5 changed files with 8 additions and 17 deletions

1
.gitignore vendored
View file

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

View file

@ -1,3 +1,5 @@
# 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,12 +1,2 @@
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 cancelled input."
echo "User canceled 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 cancelled input."
echo "User canceled 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 cancelled input."
echo "User canceled input."
exit
fi

View file

@ -9,7 +9,7 @@ int main(int num_arg, char **args)
if (num_arg <= 1)
{
system("quadratic-tui"); // make sure it is in PATH along with "quadratic" bin
system("/bin/sh /home/linux/Documents/Projects/quadratic/quadratic-tui"); //! need a better solution
}
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("%g+%gi\t %g-%gi\n", real_part, imaginary_part, real_part, imaginary_part);
printf("%f+%fi %f-%fi\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("%g\t %g\n", zero_1_ptr, zero_2_ptr);
printf("%f %f\n", zero_1_ptr, zero_2_ptr);
};
};
return 0;