Git Product home page Git Product logo

computorv1's Introduction

computorv1

The goal of this project is to get acquainted with handling elementary math tools that may be helpful for other 42 projects. You will not “do math for doing math”, but to develop a progressive and relaxed approach to projects where these tools are needed.

computorv1 is a polynomial equation solver that efficiently handles linear and quadratic equations. It utilizes the Logos Lexer for lexical analysis and Clap for command-line argument parsing, ensuring a seamless and user-friendly experience.

Installation

To install computorv1, follow these steps:

  1. Ensure that you have Rust installed on your system. If not, install Rust from the official website.
  2. Clone the computorv1 repository:
  3. Navigate to the cloned directory:
  4. Build the project using Cargo, Rust's package manager and build system:
  5. Navigate to the binary:
    git clone https://github.com/0xSpyC/computorv1.git
    cd computorv1
    cargo build --release
    cd target/release

Usage

To solve a polynomial equation using computorv1, use the following command syntax:

./computorv1 "<polynomial>"

A polynomial is an equation with the Following Form : $P(x) = a_n x^n + a_{n-1} x^{n-1} + \cdots + a_2 x^2 + a_1 x + a_0$

Replace with the equation you want to solve. For example:

./computorv1 "2 * X^2 + 4 * X + 1 = 0"

This command will output the solution to the specified quadratic equation.

Testing

computorv1 comes with a suite of tests to ensure its reliability and accuracy. To run these tests, use the following command:

cargo test
cargo test --test <specific_test>

This will execute all tests defined in the project, verifying the functionality of various components including the polynomial solver, Logos Lexer, polynomial parser. Specific tests are : polynomial, tokenize, parsing

Mandatory

  • • The equation in its reduced form.
  • • The degree of the equation.
  • • Its solution(s) and the polarity of the discriminant if it makes sense.

Bonus

  • • Manage entry mistakes (vocabulary and syntax).
  • • Manage free form entrie.
  • • Display solution(s) as an irreducible fraction if it’s interesting.
  • • Display the intermediate steps.

For further information or if you encounter any issues submit an issue on the GitHub repository.

computorv1's People

Contributors

0xspyc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.