Skip to content

Commit

Permalink
Revert "Made some changes in NonInteractive mode"
Browse files Browse the repository at this point in the history
This reverts commit 283f27b.
  • Loading branch information
dyachaliin committed Feb 19, 2022
1 parent 283f27b commit 4d0885b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Binary file not shown.
6 changes: 3 additions & 3 deletions quadratic-equation-solver/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import Foundation

func quadraticEquationSolver(a: Double, b: Double, c: Double) {
if a == 0 {
fatalError("Error. a cannot be 0")
assertionFailure("Error. a cannot be 0")
}

var discriminantRes: [Int] = []
var discriminantRes: [Double] = []
print("Equation is: (\(a)) x^2 + (\(b)) x + (\(c)) = 0")

let discriminant = b * b - 4 * a * c
Expand Down Expand Up @@ -42,7 +42,7 @@ func inputCoeff(coefficient: String) -> Double {
while flag {
print("\(coefficient) = ", terminator: "")
let validCoeff = readLine()!
if (Int(validCoeff)) != nil {
if (Double(validCoeff)) != nil {
flag = false
return Double(validCoeff)!
} else {
Expand Down

0 comments on commit 4d0885b

Please sign in to comment.