A simple quadratic equation solver
Project description
quadratic-cos10009-demo
This is a demo for COS10009 - Introduction to Programming - Swinburne University of Technology.
Installation
pip install quadratic-cos10009-demo
Usage
from quadratic import solve
# Solve x^2 - 5x + 6 = 0
x1, x2 = solve(1, -5, 6)
print(x1, x2) # 3.0 2.0
Exceptions
If the equation has no real roots, a ValueError is raised:
from quadratic import solve
try:
x1, x2 = solve(1, 0, 1) # no real roots
except ValueError as e:
print(e) # No real roots exist
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quadratic_cos10009_demo-1.0.2.tar.gz.
File metadata
- Download URL: quadratic_cos10009_demo-1.0.2.tar.gz
- Upload date:
- Size: 1.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88f461ee385f178362afa48d1d5cf4b400487a7465143063224aa391f63bcf62
|
|
| MD5 |
97244ea5d974db07cb459a93c0371d59
|
|
| BLAKE2b-256 |
77049fc88cbeb3ea1265e3e904ade9645d294dee13608d3fc1cd4d0edd530e50
|
File details
Details for the file quadratic_cos10009_demo-1.0.2-py3-none-any.whl.
File metadata
- Download URL: quadratic_cos10009_demo-1.0.2-py3-none-any.whl
- Upload date:
- Size: 2.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9ea79916dfc9df7c2237d04b7ad70398c9559ada2950b71330f053d2ed8978e
|
|
| MD5 |
8b8d5f5928eb9a7019a18620f3b69f43
|
|
| BLAKE2b-256 |
5ff6091c53947ef398d3854272f501f7596fa7dd817f929218180fe7b19e49a2
|