Metadata-Version: 2.4
Name: gmathlib
Version: 0.1.0
Summary: Pustaka parser matematika canggih dengan dukungan PEMDAS dan bilangan kompleks
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# GMath

> The super-caring, lightweight Python math expression parser library you've been waiting for.

[![Python Version](https://img.shields.io/badge/python-3.8%2B-blue.svg)](https://www.python.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

**GMath** is a tiny yet powerful Python library designed to evaluate mathematical expressions with strict **PEMDAS** operator precedence, native **complex numbers (i notation)** support, flexible unknown variable handling, and whitespace-insensitive evaluation.

---

## Quick Start

Install the library directly via pip:

    pip install gmath

Then use it in your code like this:

    import gmath

    # 1. PEMDAS precedence & no whitespace needed
    print(gmath.math("50+20*3"))     # Output: 110.0

    # 2. Natural complex numbers using 'i' notation
    print(gmath.math("10+5i-2*3"))   # Output: (4+5i)

    # 3. Unknown variables? Safely preserved as-is
    print(gmath.math("50+h"))        # Output: 50+h

    # 4. Nested parentheses support
    print(gmath.math("(5+2)*3"))     # Output: 21.0

---

## Key Features

* **True PEMDAS / BODMAS**: Accurately computes multiplication, division, and exponents following strict mathematical order of operations.
* **Complex Number Native**: Seamlessly parses and calculates numbers using 'i' notation under the hood and formats them back cleanly.
* **Super-Caring Variable Handling**: Won't crash on unrecognized letters or variables (like x or h), gracefully returning them as part of the expression.
* **Whitespace Insensitive**: Type your expressions tightly without spaces and it will still parse everything accurately.

---

## License

This project is distributed under the **MIT License** — check the LICENSE file for more details.
