Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def quadraticEquation(a, b, c)
- x = -50.0
- output_array = Array.new
- y = 0
- while (x <= 50)
- if a * x ** 2 + b * x + c == 0 then
- output_array[y] = x.to_f
- y = y + 1
- end
- x = x + 0.5
- end
- return output_array.sort
- end
Advertisement
Add Comment
Please, Sign In to add comment